上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 33 下一页
摘要: class Solution(object): def containsDuplicate(self, nums): """ :type nums: List[int] :rtype: bool """ count=collections.Counter(nums) for i in coun... 阅读全文
posted @ 2019-03-20 07:47 周洋 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 送分题 阅读全文
posted @ 2019-03-20 07:33 周洋 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 送分题 阅读全文
posted @ 2019-03-20 07:28 周洋 阅读(104) 评论(0) 推荐(0) 编辑
摘要: chr():十进制或十六进制数(0-255)转成对应的ASCII字符. ord():ASCII字符转成对应的十进制数. 一个小性质:ASCII表中大写字母排在前面小写排在后面,相差32. 比如: 阅读全文
posted @ 2019-03-20 07:21 周洋 阅读(2192) 评论(0) 推荐(0) 编辑
摘要: #approach 1 class Solution: def toLowerCase(self, str): return "".join(chr(ord(c) + 32) if "A" <= c <= "Z" else c for c in str) #approach 2 class Solution: def toLowerCase(self, str)... 阅读全文
posted @ 2019-03-20 07:15 周洋 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 改写:(都不会改变原字符串) #大变小小变大 s.swapcase()Out[15]: 'HeLLO WoRLD' 判断: 阅读全文
posted @ 2019-03-20 07:04 周洋 阅读(3821) 评论(0) 推荐(0) 编辑
摘要: class Solution(object): def isPerfectSquare(self, num): """ :type num: int :rtype: bool """ for x in range(1000000): if x*x==num: ... 阅读全文
posted @ 2019-03-19 07:21 周洋 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 二分搜索 阅读全文
posted @ 2019-03-19 06:44 周洋 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 送分题 阅读全文
posted @ 2019-03-18 05:49 周洋 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 判断两个矩形相交的经典问题. 两种方法: 阅读全文
posted @ 2019-03-18 04:46 周洋 阅读(161) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 33 下一页