自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 牛客网笔试 python 读取多行输入

import sysnum = sys.stdin.readline().strip()list = []try: while True: line = sys.stdin.readline().strip() if line == '': break lines = line.split() #...

2019-03-16 09:51:49 12311

原创 217. Contains Duplicate

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is...

2018-03-23 14:31:39 158

原创 189. Rotate Array

Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Note:Try to come up as many solutions as you can, ther...

2018-03-23 12:02:17 198

原创 122. Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one an...

2018-03-23 11:43:25 211 1

原创 26.Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifying the ...

2018-03-23 11:28:52 158

原创 leet code2 Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...

2018-03-15 13:42:53 254

原创 leetcode 9 Palindrome Number

判断一个整形变量是否是回文数。class Solution(object):    def isPalindrome(self, x):        """        :type x: int        :rtype: bool        """        a = str(x)        return(a==a[::-1])//str[a:-b:c]表示输出字符串从a位置开始...

2018-03-05 10:36:41 170

原创 leetcode 7 Reverse Integer

Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21//给出一个32位有符号整形变量,对这个整形变量进行反转//由于我把整形转为字符...

2018-03-05 10:09:01 173

原创 leetcode 1 Two Sum

Given nums = [2, 7, 11, 15], target = 9,Because nums[0] + nums[1] = 2 + 7 = 9,return [0, 1]//给定一个数组与目标值,使列表中两数相加等于目标值,返回值为两数在列表中的位置。class Solution(object):    def twoSum(self, nums, target):       ...

2018-03-05 09:19:25 253

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除