Then-queens puzzle is the problem of
placingnqueens on ann×nchessboard such that no two queens attack each
other.Given an integern, return all distinc...
分类:
其他好文 时间:
2014-06-04 20:00:47
阅读次数:
206
The set[1,2,3,…,n]contains a total ofn! unique
permutations.By listing and labeling all of the permutations in order,We get the
following sequence (ie...
分类:
其他好文 时间:
2014-06-04 19:56:17
阅读次数:
347
Given an array of strings, return all groups of
strings that are anagrams.Note: All inputs will be in
lower-case.classSolution{public:vectoranagrams(v...
分类:
其他好文 时间:
2014-06-04 19:29:39
阅读次数:
247
Given a sorted linked list, delete all
duplicates such that each element appear onlyonce.For
example,Given1->1->2, return1->2.Given1->1->2->3->3,
retu...
分类:
其他好文 时间:
2014-06-04 19:19:16
阅读次数:
205
Given a collection of numbers that might
contain duplicates, return all possible unique permutations.For
example,[1,1,2]have the following unique perm...
分类:
其他好文 时间:
2014-06-04 19:10:54
阅读次数:
240
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,...
分类:
其他好文 时间:
2014-06-04 19:10:16
阅读次数:
155
Given a string S and a string T, find the
minimum window in S which will contain all the characters in T in complexity
O(n).For example,S="ADOBECODEBA...
Given a collection of integers that might
contain duplicates,S, return all possible subsets.Note: Elements in a subset
must be in non-descending o...
分类:
其他好文 时间:
2014-06-04 18:37:55
阅读次数:
322
Given a linked list and a valuex, partition it
such that all nodes less thanxcome before nodes greater than or equal tox.You
should preserve the origi...
分类:
其他好文 时间:
2014-06-03 14:12:24
阅读次数:
306
Given a string containing only digits, restore
it by returning all possible valid IP address combinations.For
example:Given"25525511135",return["255.2...
分类:
其他好文 时间:
2014-06-03 14:06:24
阅读次数:
271