Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))...
分类:
其他好文 时间:
2014-10-16 01:27:21
阅读次数:
272
递归:class Solution: # @param candidates, a list of integers # @param target, integer # @return a list of lists of integers def combinationS...
分类:
其他好文 时间:
2014-10-14 14:38:48
阅读次数:
148
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,4],
[2,3],
[1,2],
[1,3],
[1,4],
]...
分类:
其他好文 时间:
2014-10-12 20:53:58
阅读次数:
191
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.35"]. (Order ...
分类:
其他好文 时间:
2014-10-08 10:45:25
阅读次数:
195
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],...
分类:
其他好文 时间:
2014-10-07 20:22:03
阅读次数:
229
题目:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"(((...
分类:
其他好文 时间:
2014-10-06 20:28:50
阅读次数:
186
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-10-06 13:41:10
阅读次数:
154
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:
其他好文 时间:
2014-10-05 16:48:38
阅读次数:
193
题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telep...
分类:
其他好文 时间:
2014-10-05 15:11:48
阅读次数:
206
Letter Combinations of a Phone Number
Total Accepted: 17652 Total
Submissions: 66854My Submissions
Given a digit string, return all possible letter combinations that the number could repr...
分类:
其他好文 时间:
2014-09-30 19:28:09
阅读次数:
183