这道题也属于排列组合问题,所以用recursive。属于深度优先的题目。这道题和单纯的subset和permutation略有不同,因为是从不同数字代表的字母中选,而每个数字内部的组合不需要。 在想这道题的时候我们可以先想两个数字,就是从第一个的数字所代表的字母中依次选出,然后和下一个数字代表的字母 ...
分类:
其他好文 时间:
2016-08-19 07:30:32
阅读次数:
134
17.LetterCombinationsofaPhoneNumberGivenadigitstring,returnallpossiblelettercombinationsthatthenumbercouldrepresent.Amappingofdigittoletters(justlikeonthetelephonebuttons)isgivenbelow.Input:Digitstring"23"Output:["ad","ae","af","bd","be","bf","cd","ce","cf"..
分类:
其他好文 时间:
2016-08-19 06:26:53
阅读次数:
181
let letter=[{ sLetter:'a', sNumber:0, bletter:'A', bNumber:0 },{ sLetter:'b', sNumber:0, bletter:'B', bNumber:0 },{ sLetter:'c', sNumber:0, bletter:'C ...
分类:
其他好文 时间:
2016-08-18 08:40:55
阅读次数:
236
题目
Given a 2D board containing 'X' and 'O' (the letter O),
capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's into 'X's
in that surrounded region.
For exam...
分类:
其他好文 时间:
2016-08-15 22:28:34
阅读次数:
188
Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequen ...
分类:
其他好文 时间:
2016-08-14 13:06:05
阅读次数:
150
227 PuzzleA children’s puzzle that was popular 30 years ago consisted of a 55 frame which contained 24 smallsquares of equal size. A unique letter of ...
分类:
其他好文 时间:
2016-08-14 07:50:00
阅读次数:
204
An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations: a) it --> it (no abbrev ...
分类:
其他好文 时间:
2016-08-13 12:52:51
阅读次数:
143
题意: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the tel ...
分类:
其他好文 时间:
2016-08-12 23:29:20
阅读次数:
191
1.border边框属性可设置宽度,线样式和颜色 2.border-radius 边框圆角属性 3.border-image 后面的值可以设置4个。 4.box-shadow (加上inset就是往里面凹) 5.line-height 6.text-indent (缩进2个字符) 7.letter ...
分类:
其他好文 时间:
2016-08-12 11:37:02
阅读次数:
114
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho ...
分类:
其他好文 时间:
2016-08-12 11:27:28
阅读次数:
135