摘要: 回溯法 概括 可以分为三步: choose explore(dfs)- recursion with constraints - base case/ recursive case un-choose 假如题目问到: 需要生成所有可能的答案 or 是否存在解决方案 就需要去生成所有可能的方案,去判断 阅读全文
posted @ 2020-07-15 23:50 wuwulong 阅读(65) 评论(0) 推荐(0)
摘要: #two sum 两种常见方法 时间复杂度 O(n), 空间复杂度O(1) # two pointer for sorted array class Solution(object): def twoSum(self, numbers, target): """ :type numbers: Lis 阅读全文
posted @ 2020-07-15 23:48 wuwulong 阅读(84) 评论(0) 推荐(0)