描述: 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...
分类:
其他好文 时间:
2014-07-16 19:29:31
阅读次数:
166
Generate ParenthesesGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a sol...
分类:
其他好文 时间:
2014-07-16 18:07:04
阅读次数:
146
Restore IP AddressesGiven a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"255255...
分类:
其他好文 时间:
2014-07-16 18:03:41
阅读次数:
157
Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ...
分类:
其他好文 时间:
2014-07-16 17:54:24
阅读次数:
222
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-07-16 17:27:32
阅读次数:
139
Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes...
分类:
其他好文 时间:
2014-07-14 10:43:07
阅读次数:
222
Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum...
分类:
其他好文 时间:
2014-07-14 10:42:22
阅读次数:
192
问题:
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:
Only one letter can be changed at a time
Each intermediate wo...
分类:
编程语言 时间:
2014-07-12 19:21:38
阅读次数:
290
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-07-12 17:37:13
阅读次数:
139
1、in的用法fruit = 'banana'for letter in fruit : print letter说明:letter此处为循环控制变量in可用于逻辑判断,a in fruit 为True2、String的部分输出,[a:b]输入index值为a到b-1的字符串,若b超过length,...
分类:
编程语言 时间:
2014-07-12 14:54:50
阅读次数:
221