Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Given n pairs of parentheses, write a function ...
分类:
其他好文 时间:
2016-07-19 09:08:46
阅读次数:
113
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat ...
分类:
编程语言 时间:
2016-07-14 01:40:58
阅读次数:
191
Combination Sum | Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to ...
分类:
其他好文 时间:
2016-07-05 06:25:29
阅读次数:
154
题目描述: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 解题分析: 这类题一般都要用递归的方法来解决。需要设两个集合类分别存储待匹配的( ...
分类:
其他好文 时间:
2016-07-05 01:09:06
阅读次数:
180
题目描述: Given a digit string, return all possible letter combinations that the number could represent. 解题分析: 回溯法的典型应用,用一个数据结构表示出按键与其表示字母的对应关系,直接用回溯法做即可。 ...
分类:
其他好文 时间:
2016-07-05 01:02:26
阅读次数:
171
Problem: https://leetcode.com/problems/combination-sum-iii/ Find all possible combinations of k numbers that add up to a number n, given that only num ...
分类:
其他好文 时间:
2016-07-03 00:27:31
阅读次数:
122
背包解组合数学问题,n种物品,每种num[i]个,求取r个的方法数。 背包思想,f[j]表示当前取j个数的方法数,则状态转移方程为 f[j] += f[k](max(j - num[i], 0) <= k < j) 外层循环枚举物品,内层循环从大到小枚举空间,最内层枚举方法数。 #include<i ...
分类:
其他好文 时间:
2016-06-28 23:36:32
阅读次数:
188
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be ...
分类:
编程语言 时间:
2016-06-24 14:25:51
阅读次数:
173
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be ...
分类:
其他好文 时间:
2016-06-23 12:28:22
阅读次数:
109