
回溯算法
码不停Ti
信息安全在校大学生
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【LeetCode】39. 组合总和
给定一个无重复元素的数组candidates和一个目标数target,找出candidates中所有可以使数字和为target的组合。 candidates中的数字可以无限制重复被选取。 说明: 所有数字(包括target)都是正整数。 解集不能包含重复的组合。 示例1: 输入: candidates = [2,3,6,7], target = 7, 所求解集为: ...原创 2020-02-03 07:56:36 · 448 阅读 · 0 评论 -
47. 全排列 II【回溯算法】
给定一个可包含重复数字的序列,返回所有不重复的全排列。 示例: 输入: [1,1,2] 输出: [ [1,1,2], [1,2,1], [2,1,1] ] 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/permutations-ii 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 回溯算法,这...原创 2019-12-07 19:06:32 · 429 阅读 · 0 评论 -
46. 全排列【回溯算法】
给定一个没有重复数字的序列,返回其所有可能的全排列。 示例: 输入: [1,2,3] 输出: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/permutations 著作权归领扣网络所有。商业转载请...原创 2019-12-07 16:05:30 · 459 阅读 · 0 评论 -
【Leet Code】17. Letter Combinations of a Phone Number
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is giv...原创 2019-10-03 15:57:28 · 430 阅读 · 0 评论 -
【Leet Code】22. Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ "((()))", "(()())", "(())()", "()(())",...原创 2019-10-03 16:28:48 · 388 阅读 · 0 评论