摘要:
class Solution(object): def containsDuplicate(self, nums): """ :type nums: List[int] :rtype: bool """ count=collections.Counter(nums) for i in coun... 阅读全文
摘要:
送分题 阅读全文
摘要:
送分题 阅读全文
摘要:
chr():十进制或十六进制数(0-255)转成对应的ASCII字符. ord():ASCII字符转成对应的十进制数. 一个小性质:ASCII表中大写字母排在前面小写排在后面,相差32. 比如: 阅读全文
摘要:
#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)... 阅读全文
摘要:
改写:(都不会改变原字符串) #大变小小变大 s.swapcase()Out[15]: 'HeLLO WoRLD' 判断: 阅读全文