摘要:
先给出一个我自己写的方案,TLE 1 class Solution: 2 def __init__(self): 3 self.memo = dict() 4 self.memo[1] = True 5 6 def isUgly(self,num): 7 if num <= 0: 8 return 阅读全文
posted @ 2020-04-05 09:53
Sempron2800+
阅读(217)
评论(0)
推荐(0)
摘要:
1 class Solution: 2 def majorityElement(self, nums: List[int]) -> List[int]: 3 dic = dict() 4 n = len(nums) 5 for i in range(n): 6 if nums[i] not in d 阅读全文
posted @ 2020-04-05 09:25
Sempron2800+
阅读(136)
评论(0)
推荐(0)
摘要:
1 class Solution: 2 def checkOverlap(self, radius: int, x_center: int, y_center: int, x1: int, y1: int, x2: int, y2: int) -> bool: 3 4 # Getting the c 阅读全文
posted @ 2020-04-05 05:05
Sempron2800+
阅读(153)
评论(0)
推荐(0)
摘要:
1 class Solution: 2 def canConstruct(self, s: str, k: int) -> bool: 3 #奇数个字符出现的数量 <= k 4 #所有的字符的类别数量 >= k 5 dic = dict() 6 n = len(s) 7 for i in range 阅读全文
posted @ 2020-04-05 05:00
Sempron2800+
阅读(142)
评论(0)
推荐(0)
摘要:
1 class Solution: 2 def calSum(self,x): 3 s = str(x) 4 sums = 0 5 for j in range(len(s)): 6 sums += int(s[j]) 7 return sums 8 9 def countLargestGroup( 阅读全文
posted @ 2020-04-05 04:55
Sempron2800+
阅读(172)
评论(0)
推荐(0)
浙公网安备 33010602011771号