自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

善积跬步

daydayup

  • 博客(11)
  • 收藏
  • 关注

原创 LintCode Python 101. 删除排序数组中的重复数字 II

def removeDuplicates(self, nums): # write your code here if nums == []: return 0 index,count = 0, 1 for i in range(1, len(nums)): if nums[index] == nums[i] and count &l...

2018-03-10 20:50:55 443

原创 LintCode Python 54.转换字符串到整数

def atoi(self, str): # write your code here str = str.strip() if (str == '' or str[0] == '.' or '-' in str[1:] or str.count('.') > 1 o...

2018-03-10 18:15:59 203

原创 LintCode Python 78.公共子串

Ldef longestCommonPrefix(self, strs): # write your code here if '' in strs or strs == []: return '' s, n = '', '' for j in range(min([len(i) for i in strs])): for i in ...

2018-03-09 21:21:55 169

原创 LintCode Python 79.最长公共子串

def longestCommonSubstring(self, A, B): # write your code here if A == '' or B == '': return 0 if len(A) >= len(B): L, L1 = A[:], B[:] el...

2018-03-09 20:33:21 231

原创 LintCode Python 55.比较字符串

def compareStrings(A, B): # write your code here if len(A) < len(B): return False if len(A) == len(B): return(sorted(A) == sorted(B)) for i in B: if A.count(...

2018-03-09 19:56:59 426 1

原创 LintCode Python 171.乱序字符串

def anagrams(self, strs): # write your code here L = [i if len(i) <= 1 else sorted(i) for i in strs] return [strs[i] for i in range(len(L)) if L.count(L[i]) > 1]

2018-03-09 19:55:40 370

原创 LintCode Python 合并排序数组

class Solution: #@param A and B: sorted integer array A and B. #@return: A new sorted integer array def mergeSortedArray(self, A, B): # write your code here return sorted(A

2017-08-13 19:35:58 418

原创 LintCode Python 第k大元素

class Solution: # @param k & A a integer and an array # @return ans a integer def kthLargestElement(self, k, A): A = sorted(A, reverse=True) return A[k-1]

2017-08-13 19:32:04 824

原创 LintCode Python 丑数II

class Solution: """ @param {int} n an integer. @return {int} the nth prime number as description. """ def nthUglyNumber(self, n): # write your code here L = [0

2017-08-13 19:19:50 386

原创 LintCode Python 统计数字

class Solution: # @param k & n two integer # @return ans a integer def digitCounts(self, k, n): L = ''.join([str(i) for i in range(n+1)]) c = L.count(str(k)) retur

2017-08-13 19:17:24 822

原创 LintCode Python 尾部的零

class Solution: # @param n a integer # @return as a integer def trailingZeros(self, n): if n == 0: return 1 x = 0 while n > 5: x += n //

2017-08-13 19:14:39 294 1

空空如也

空空如也

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

TA关注的人

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