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:"((...
分类:
其他好文 时间:
2014-11-21 06:58:22
阅读次数:
262
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each numb...
分类:
其他好文 时间:
2014-11-21 06:57:39
阅读次数:
184
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 repeate...
分类:
其他好文 时间:
2014-11-21 06:57:28
阅读次数:
212
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
分类:
其他好文 时间:
2014-11-19 12:05:22
阅读次数:
204
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
Each number in C may only be used once in the combina...
分类:
其他好文 时间:
2014-11-18 16:02:52
阅读次数:
247
给定n和k,从1到n中选k个数,存到结果中。其实就是组合问题。例如Ifn= 3, k = 2, 结果是 {1,2], [1,3], [2,3] };思路:利用回溯法。class Solution {public: void dfs77(vector > &ans, vector subans,...
分类:
其他好文 时间:
2014-11-16 22:51:05
阅读次数:
208
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:"((()))", "(()())", "(())()", "()(())", "()()()"思路分析:...
分类:
其他好文 时间:
2014-11-16 10:44:42
阅读次数:
164
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,.....
分类:
其他好文 时间:
2014-11-16 09:23:31
阅读次数:
132
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example:Given "25525511135",return ["25...
分类:
其他好文 时间:
2014-11-16 00:29:23
阅读次数:
338
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
分类:
其他好文 时间:
2014-11-13 23:52:11
阅读次数:
363