摘要: 参考:https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows/discuss/303752/Python-1-Line 1行代码的风格,很Pythonic,执行效率还很高,我只想说——AWSL。 参考:h 阅读全文
posted @ 2019-06-02 16:16 Sempron2800+ 阅读(408) 评论(0) 推荐(0) 编辑
摘要: -2进制转10进制,10进制再转-2进制。 阅读全文
posted @ 2019-06-02 11:53 Sempron2800+ 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 另一种写法: 阅读全文
posted @ 2019-06-02 10:58 Sempron2800+ 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 上面的代码使用回溯法,但是TLE。考虑需要使用动态规划提升效率,目前还做不出来。 看到一个同样思路的解决方案,使用java语言,却可以AC,这难道又是leetcode平台的“语言杀”? 这种同样思路,使用java可以AC,但是使用.net或python却TLE的情况,我是遇到过几次的。 但也有可能是 阅读全文
posted @ 2019-06-02 07:06 Sempron2800+ 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def indexPairs(self, text: str, words: 'List[str]') -> 'List[List[int]]': 3 result = list() 4 n = len(text) 5 for word in words: 6 be... 阅读全文
posted @ 2019-06-02 06:24 Sempron2800+ 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 思路1:使用顺序查找 思路2:使用二分查找 阅读全文
posted @ 2019-06-02 06:23 Sempron2800+ 阅读(313) 评论(0) 推荐(0) 编辑