摘要: 1 class Solution: 2 def factorial(self,N): 3 result = 1 4 while N > 0: 5 result *= N 6 N -= 1 7 return result 8 9 def numPrimeArrange... 阅读全文
posted @ 2019-09-10 21:14 Sempron2800+ 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1 import collections 2 import bisect 3 4 class Solution: 5 def getFC(self,word): 6 obj = collections.Counter(word) 7 for i in range(97,123): 8 c = chr(i) 9 if c in obj: 10 return obj[c] 11 12 def numS 阅读全文
posted @ 2019-09-10 16:41 Sempron2800+ 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def isLeap(self,year): 3 if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): 4 return True 5 return False 6 7 def dayOfYea... 阅读全文
posted @ 2019-09-10 16:13 Sempron2800+ 阅读(150) 评论(0) 推荐(0) 编辑