Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:
其他好文 时间:
2015-01-21 22:12:18
阅读次数:
246
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],...
分类:
其他好文 时间:
2015-01-20 23:39:07
阅读次数:
255
题目:
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...
分类:
编程语言 时间:
2015-01-20 22:22:42
阅读次数:
241
Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,...
分类:
其他好文 时间:
2015-01-20 22:00:51
阅读次数:
127
Given a collection of numbers, return all possible permutations.
For example,
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
and [3,2,1].
C++:
class S...
分类:
其他好文 时间:
2015-01-20 13:51:03
阅读次数:
247
Scramble StringGiven a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible...
分类:
其他好文 时间:
2015-01-19 23:28:51
阅读次数:
244
【题目】
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1],
an...
分类:
其他好文 时间:
2015-01-19 12:49:17
阅读次数:
133
题意: NxN的地图,上面有A颜色的瓷砖以及一些空格点,要用B,C,D颜色去填充这些空格,只能十字形的填充,还要保证共角或共边的格子不能是相同颜色,求一种字典序最小的填充方法,如果不能,输出"Not Possible"。解法: 从上往下扫,如果有空格,那么一定是以它下面那个格子为中心填十字瓷砖才能填...
分类:
其他好文 时间:
2015-01-19 01:39:50
阅读次数:
216
问题描述:
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
[...
分类:
其他好文 时间:
2015-01-18 18:36:06
阅读次数:
158
No need for a double cycle: :You are given N counters, initially set to 0, and you have two possible operations on them:increase(X) ? counter X is inc...
分类:
其他好文 时间:
2015-01-18 18:26:32
阅读次数:
222