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.35"]. (Order...
分类:
其他好文 时间:
2015-07-27 11:12:45
阅读次数:
645
// 给定一个set字符和一个正数k,找出所有该做set它可以由长度构成k该字符串集合 /* Input: set[] = {'a', 'b'}, k = 3 Output: aaa aab aba abb baa bab bba bbb Input: set[] = {'a', 'b', ...
分类:
其他好文 时间:
2015-07-27 09:21:14
阅读次数:
139
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:
其他好文 时间:
2015-07-26 20:36:39
阅读次数:
82
题意:给一个电话号码,要求返回所有在手机上按键的组合,组合必须由键盘上号码的下方的字母组成。思路:尼玛,一直RE,题意都不说0和1怎么办。DP解决。 1 class Solution { 2 public: 3 vector ans; 4 string str; 5 6 v...
分类:
其他好文 时间:
2015-07-26 17:05:54
阅读次数:
97
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited numb...
分类:
其他好文 时间:
2015-07-25 20:00:54
阅读次数:
138
Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))...
分类:
其他好文 时间:
2015-07-23 09:22:36
阅读次数:
110
【022-Generate Parentheses(生成括号)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3...
分类:
编程语言 时间:
2015-07-23 08:15:55
阅读次数:
137
Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ...
分类:
其他好文 时间:
2015-07-22 18:00:14
阅读次数:
91
Given 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 solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3],
[1,4],
]...
分类:
其他好文 时间:
2015-07-22 14:43:15
阅读次数:
81
077 Combinations这道题纯dfs, 但是在 Line 13处做了个剪枝 从84ms 提高到68 ms 1 class Solution: 2 def __init__(self): 3 self.ans = [] 4 5 def combine...
分类:
其他好文 时间:
2015-07-22 01:23:15
阅读次数:
120