上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: def aa(nums,s): i=0 leng=len(nums) ret=[] while i<leng-s+1: ret.append(max(nums[i:i+s])) i +=1 return ret print(aa([2,3,4,2,6,2,5,1],3)) 阅读全文
posted @ 2018-10-29 14:40 findtruth123 阅读(532) 评论(0) 推荐(0) 编辑
摘要: def aa(s,n): #n%=len(s) return s[n:]+s[:n] print(aa('abddh',2)) 阅读全文
posted @ 2018-10-29 14:18 findtruth123 阅读(115) 评论(0) 推荐(0) 编辑
摘要: def aa(string): if not string: return False a=string.split() return ' '.join(a[::-1]) print(aa('I am a engineer.')) 阅读全文
posted @ 2018-10-29 14:04 findtruth123 阅读(167) 评论(0) 推荐(0) 编辑
摘要: def sum_to_s(s): a, b = 1, 2 ret = [] while a < s / 2 + 1: if sum(range(a, b+1)) == s: ret.append(range(a, b+1)) a += 1 elif sum(range(a, b+1)) < s... 阅读全文
posted @ 2018-10-29 11:20 findtruth123 阅读(258) 评论(0) 推荐(0) 编辑
摘要: def aa(nums,s): left,right=0,len(nums)-1 while left s: right -=1 else : left +=1 return None print(aa([1,2,3,4,5],3)) 阅读全文
posted @ 2018-10-29 10:54 findtruth123 阅读(289) 评论(0) 推荐(0) 编辑
摘要: def aa(nums): hashes={} for s in nums: hashes[s]=hashes[s]+1 if hashes.get(s) else 1 for s in nums: if hashes[s]==1: print (s) return print(... 阅读全文
posted @ 2018-10-29 10:45 findtruth123 阅读(200) 评论(0) 推荐(0) 编辑
摘要: def aa(nums): hashes={} for s in nums: hashes[s]=hashes[s]+1 if hashes.get(s) else 1 for s in nums: if hashes[s]==1: print (s) return print(... 阅读全文
posted @ 2018-10-29 10:43 findtruth123 阅读(335) 评论(0) 推荐(0) 编辑
摘要: def aa(nums): leng=len(nums) for i in range(leng): if i==nums[i]: print (i) i+=1 return None print(aa([0,1,2,3,4,5])) 阅读全文
posted @ 2018-10-29 10:36 findtruth123 阅读(269) 评论(0) 推荐(0) 编辑
摘要: def aa(nums,n): for i in range(n): if i ==nums[i]: i +=1 else: return i print(aa([0,1,2,3,4,5,7],8)) 阅读全文
posted @ 2018-10-29 10:32 findtruth123 阅读(457) 评论(2) 推荐(0) 编辑
摘要: def aa(nums): if not nums: return False hashes={} ret=[] for s in nums: hashes[s]=hashes[s]+1 if hashes.get(s) else 1 for s in nums: ret.append([s... 阅读全文
posted @ 2018-10-29 10:11 findtruth123 阅读(164) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页