摘要:
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
周洋
阅读(105)
评论(0)
推荐(0)
摘要:
送分题 阅读全文
posted @ 2019-03-20 07:33
周洋
阅读(74)
评论(0)
推荐(0)
摘要:
送分题 阅读全文
posted @ 2019-03-20 07:28
周洋
阅读(107)
评论(0)
推荐(0)
摘要:
chr():十进制或十六进制数(0-255)转成对应的ASCII字符. ord():ASCII字符转成对应的十进制数. 一个小性质:ASCII表中大写字母排在前面小写排在后面,相差32. 比如: 阅读全文
posted @ 2019-03-20 07:21
周洋
阅读(2247)
评论(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
周洋
阅读(158)
评论(0)
推荐(0)
摘要:
改写:(都不会改变原字符串) #大变小小变大 s.swapcase()Out[15]: 'HeLLO WoRLD' 判断: 阅读全文
posted @ 2019-03-20 07:04
周洋
阅读(3833)
评论(0)
推荐(0)

浙公网安备 33010602011771号