码迷,mamicode.com
首页 >  
搜索关键字:letter combinations    ( 2407个结果
Letter Combinations of a Phone Number
题目 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. In...
分类:其他好文   时间:2014-06-18 12:03:16    阅读次数:227
【Leetcode】Combinations
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], ]...
分类:其他好文   时间:2014-06-18 11:41:52    阅读次数:156
Generate Parentheses
题目 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-06-17 22:59:06    阅读次数:223
LeetCode - Restore IP Addresses
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 do...
分类:其他好文   时间:2014-06-16 19:24:42    阅读次数:248
Combination Sum
题目 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 un...
分类:其他好文   时间:2014-06-15 20:00:18    阅读次数:185
Combination Sum II
题目 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
[LeetCode] Combinations [38]
题目 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],...
分类:其他好文   时间:2014-06-15 14:10:54    阅读次数:239
Leetcode: Letter Combinations of a Phone Number
像这种DFS的题目,常见的写法无外乎两种,使用recursion, 或者用Stack。本文采用了stack的方式。做完后积累的经验有:像这种在一个ArrayList里面罗列可能的path的题目,recursion的参数一般包括:包含最终结果的集合(ArrayList),input(String),递...
分类:其他好文   时间:2014-06-13 08:34:10    阅读次数:220
每日算法之三十一:Combination Sum
给定一个整数序列,求解一个子序列,子序列之和等于给定目标值。子序列满足以下条件: 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
[leetcode]Letter Combinations of a Phone Number @ Python
原题地址: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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!