My original thought was to calculate all the
possible transactions by using nested loop. But got time limit excess error.I
knew it can be done in O(n)...
分类:
其他好文 时间:
2014-05-29 20:44:37
阅读次数:
271
原题地址:https://oj.leetcode.com/problems/subsets-ii/题意:Given
a collection of integers that might contain duplicates,S, return all possible
subsets.Note:E...
分类:
编程语言 时间:
2014-05-29 19:10:53
阅读次数:
278
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-05-27 02:42:35
阅读次数:
202
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...
分类:
其他好文 时间:
2014-05-26 11:24:36
阅读次数:
214
Palindrome Partitioning
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 = "...
分类:
其他好文 时间:
2014-05-24 14:29:45
阅读次数:
222
It is not possible using the .NET BCL. However if
you really want it you can use native SetCursorPos inUser32.dll.
[DllImport("User32.dll")]private st...
分类:
其他好文 时间:
2014-05-23 10:16:34
阅读次数:
236
【题目】
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].
【题意】
给定一个数组,生成所有的全排列
【思路】
递归,类DFS...
分类:
其他好文 时间:
2014-05-23 01:08:26
阅读次数:
194
【题目】
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], and [2,1,1].
【题意】
给定一个候选数集合,候选集中可能存在重复数,返回所有的排列
【思路】
...
分类:
其他好文 时间:
2014-05-22 17:32:17
阅读次数:
247
Description
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a ...
分类:
其他好文 时间:
2014-05-21 10:58:39
阅读次数:
237
【题目】
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below.
Input:Digit string "23"
Output: ["ad", "ae", "af", "bd", "be", "bf",...
分类:
其他好文 时间:
2014-05-18 07:30:12
阅读次数:
340