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-08-17 16:44:42
阅读次数:
179
Problem Description
The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:
Tout avait...
分类:
其他好文 时间:
2014-08-16 19:50:11
阅读次数:
239
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:
其他好文 时间:
2014-08-16 17:03:50
阅读次数:
174
题目一:根据电话上字母和数字的对应关系,用一个有意义的单词来表述一个电话号码,如用computer表示26678837
题目二:反过来,给定一个电话号码,是否可以用一个单词来表示呢?怎样表示最快呢?显然不是所有的电话号码都可以对应到单词上去
首先来看看leetcode上一个类似的题目:
Letter Combinations of a Phone Number
G...
分类:
其他好文 时间:
2014-08-15 16:11:50
阅读次数:
257
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,.....
分类:
其他好文 时间:
2014-08-14 20:26:49
阅读次数:
202
hdu 4929 Another Letter Tree(LCA+DP)
题意:有一棵树n个节点(n
解法:一个很直观的想法,求出lca(设其为w)后,枚举x,求出a到w的路径上,能匹配s0的x长度前缀的情况有多少种,令其为c[x]。再求出b到w的路径上能匹配s0的L-x(L表示s0的长度)长度后缀的情况有多少种,令其为d[l-x],那么将所有的c[x]*d[l-x](x属于[0,l]...
分类:
其他好文 时间:
2014-08-13 10:38:05
阅读次数:
346
Problem StatementThe Happy Letter game is played as follows: At the beginning, several players enter the field. Each player has a lowercase English le...
分类:
移动开发 时间:
2014-08-13 03:33:35
阅读次数:
201
问题:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"(((...
分类:
其他好文 时间:
2014-08-11 14:31:22
阅读次数:
169
Problem Description:
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-08-08 21:20:46
阅读次数:
327
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 repeate...
分类:
其他好文 时间:
2014-08-08 20:54:46
阅读次数:
246