题目
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers
sums to T.
Each number in C may only be used once in...
分类:
其他好文 时间:
2014-06-15 19:24:21
阅读次数:
229
像这种DFS的题目,常见的写法无外乎两种,使用recursion,
或者用Stack。本文采用了stack的方式。做完后积累的经验有:像这种在一个ArrayList里面罗列可能的path的题目,recursion的参数一般包括:包含最终结果的集合(ArrayList),input(String),递...
分类:
其他好文 时间:
2014-06-13 08:34:10
阅读次数:
220
Implement an algorithm to print all valid (
properly opened and closed) combinations of n-pairs of parentheses.思路:比如 n = 3,
((())) 就是一个valid combinati...
分类:
其他好文 时间:
2014-06-11 13:19:00
阅读次数:
306
Givennpairs of parentheses, write a function to
generate all combinations of well-formed parentheses.For example, givenn= 3, a
solution set is:"((()))...
分类:
其他好文 时间:
2014-06-11 12:25:51
阅读次数:
239
给定一个整数序列,求解一个子序列,子序列之和等于给定目标值。子序列满足以下条件:
1)子序列是有序的
2)子序列的元素个数不限,可以是给定元素的重复元素。
3)结果中的子序列是唯一的
原题描述如下:
Given a set of candidate numbers (C) and a target number (T), find all unique combinations ...
分类:
其他好文 时间:
2014-06-11 06:26:03
阅读次数:
302
原题地址:https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/题意:Given
a digit string, return all possible letter combinations that the ...
分类:
编程语言 时间:
2014-06-10 16:40:57
阅读次数:
223
原题地址:https://oj.leetcode.com/problems/combination-sum/题意:Given
a set of candidate numbers (C) and a target number (T), find all unique
combinations in...
分类:
编程语言 时间:
2014-06-09 17:50:09
阅读次数:
333
题目链接Givennpairs of parentheses, write a function to
generate all combinations of well-formed parentheses.For example, givenn= 3, a
solution set is:"((...
分类:
其他好文 时间:
2014-06-09 15:11:33
阅读次数:
212
题目
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", "255.255.111.3...
分类:
其他好文 时间:
2014-06-08 10:37:47
阅读次数:
273
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],...
分类:
其他好文 时间:
2014-06-08 08:08:29
阅读次数:
294