backtracking
feeeeeeet
这个作者很懒,什么都没留下…
展开
-
Leetcode 17. Letter Combinations of a Phone Number
class Solution { public List<String> letterCombinations(String digits) { String[] phone = new String[]{"","","abc","def","ghi","jkl","mno","pqrs&q原创 2018-11-14 07:16:40 · 77 阅读 · 0 评论 -
Leetcode 22. Generate Parentheses
class Solution { public List<String> generateParenthesis(int n) { List<String> res=new ArrayList<String>(); generate(res,"",n,0,0); return res; } ...原创 2018-11-15 04:15:50 · 94 阅读 · 0 评论 -
Leetcode 39 & 40. Combination Sum I &II
Combination Sum Iclass Solution: def combinationSum(self, candidates, target): """ :type candidates: List[int] :type target: int :rtype: List[List[int]] ""...原创 2018-12-04 12:00:01 · 110 阅读 · 0 评论 -
Leetcode 46 & 47. Permutations I & II
BacktrackingPermutations Iclass Solution: def permute(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ res=[] tmp=[] sel...原创 2018-12-05 23:09:58 · 94 阅读 · 0 评论 -
Leetcode 95 & 96. Unique Binary Search Trees I & II
Unique Binary Search Trees IGiven n, how many structurally unique BST’s (binary search trees) that store values 1 … n?Example:Input: 3Output: 5class Solution(object): def numTrees(self, n)...原创 2019-01-02 05:04:54 · 100 阅读 · 0 评论