摘要: 参考:https://leetcode.com/problems/numbers-with-repeated-digits/discuss/256866/Python-O(logN)-solution-with-clear-explanation 以下分析过程是我自己的思路,和上面的代码思路不太一样 阅读全文
posted @ 2019-03-17 19:44 Sempron2800+ 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def shipWithinDays(self, weights: 'List[int]', D: int) -> int: 3 left = max(weights)#不能小于最重的单个货物 4 right = sum(weights)#不用大于全部货物的总重量 5 while left ... 阅读全文
posted @ 2019-03-17 15:04 Sempron2800+ 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 下面这个是简写: 阅读全文
posted @ 2019-03-17 14:15 Sempron2800+ 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def bitwiseComplement(self, N: int) -> int: 3 if N==0: 4 return 1 5 elif N==1: 6 return 0 7 8 s = list() 9 wh... 阅读全文
posted @ 2019-03-17 13:29 Sempron2800+ 阅读(143) 评论(0) 推荐(0) 编辑