problem:
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],...
分类:
其他好文 时间:
2015-04-10 09:32:46
阅读次数:
148
题目:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["25...
分类:
其他好文 时间:
2015-04-09 13:30:30
阅读次数:
169
题目链接:Restore IP Addresses
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", "25...
分类:
其他好文 时间:
2015-04-09 11:57:09
阅读次数:
191
DescriptionGiven a sequence, {A1, A2, …, An} which is guaranteed A1 > A2, …, An, you are to cut it into three sub-sequences and reverse them separately to form a new one which is the smallest possible...
分类:
编程语言 时间:
2015-04-08 16:28:10
阅读次数:
195
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, given
s = “catsanddo...
分类:
其他好文 时间:
2015-04-08 16:25:24
阅读次数:
164
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
["aa","...
分类:
其他好文 时间:
2015-04-08 15:06:58
阅读次数:
79
题目链接:Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
...
分类:
其他好文 时间:
2015-04-07 23:33:46
阅读次数:
556
题目链接:Subsets II
Given a collection of integers that might contain duplicates, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not ...
分类:
其他好文 时间:
2015-04-07 23:33:25
阅读次数:
156
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
For exa...
分类:
其他好文 时间:
2015-04-07 21:38:13
阅读次数:
138
Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ...
分类:
其他好文 时间:
2015-04-07 21:22:14
阅读次数:
126