[leetcode]Letter Combinations of a Phone Number...
分类:
其他好文 时间:
2014-09-09 12:49:58
阅读次数:
224
Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes...
分类:
其他好文 时间:
2014-09-09 10:54:08
阅读次数:
190
在1 - 10 中,求出 7 个数的排列组合。出现了超时,而超时的原因是有好多重复情况,复杂度上来说,和答案的复杂度是一样的,但是答案中重复了太多了,体会下。超时1:class Solution {public: vector > combine(int n, int k) { ...
分类:
其他好文 时间:
2014-09-06 22:28:03
阅读次数:
363
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
分类:
其他好文 时间:
2014-09-06 18:40:43
阅读次数:
224
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((...
分类:
其他好文 时间:
2014-09-06 16:05:23
阅读次数:
182
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 numb...
分类:
其他好文 时间:
2014-09-05 17:35:41
阅读次数:
227
Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))...
分类:
其他好文 时间:
2014-09-04 22:17:00
阅读次数:
185
LeetCode: CombinationsGiven 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 solu...
分类:
其他好文 时间:
2014-09-04 22:03:20
阅读次数:
221
思路: 1. 类似快排,走两遍(v=1, 分出0;v = 2,分出1)。 2. 计数排序。计数与重写。
思路:递归,每层从前往后逐步取元素。
分类:
其他好文 时间:
2014-09-03 18:06:26
阅读次数:
278