本系列博文中有很多两种思路的,其实是因为第一遍刷题的时候有一个想法,第二遍刷题的时候已经忘掉之前的思路了,又有新的想法了。
同时大部分代码我也同时PO到leetcode的对应题目的问答中去了,所以如果你也查看问题讨论的话会发现有和我一模一样的代码,其实就是我PO的:)
书接正文,基于循环的两种思路如下:
第一种思路
比如“234”这个字符串,我可以先将0...1的所有排列找到-->...
分类:
其他好文 时间:
2014-09-16 12:42:30
阅读次数:
145
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-16 00:05:09
阅读次数:
405
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 Pa...
分类:
其他好文 时间:
2014-09-12 10:16:23
阅读次数:
245
FJ打算带着他可爱的N (1 ≤ N ≤ 2,000)头奶牛去参加”年度最佳老农”的比赛.在比赛中,每个农夫把他的奶牛排成一列,然后准备经过评委检验. 比赛中简单地将奶牛的名字缩写为其头字母(the initial letter of every cow),举个例子,FJ带了Bessie, Sylv...
分类:
其他好文 时间:
2014-09-10 23:41:41
阅读次数:
237
word-spacing 只能作用于英文的单词与单词间,对于中文无效 letter-spacing 可以作用于中文。 <html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"></meta>
<style?typ...
分类:
Web程序 时间:
2014-09-10 12:48:30
阅读次数:
201
Letter Combinations of a Phone Number
Total Accepted: 15964 Total
Submissions: 60700My Submissions
Given a digit string, return all possible letter combinations that the number could repr...
分类:
其他好文 时间:
2014-09-09 13:13:39
阅读次数:
191
[leetcode]Letter Combinations of a Phone Number...
分类:
其他好文 时间:
2014-09-09 12:49:58
阅读次数:
224
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
Fermat’s Chirstmas Theorem
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
In a letter dated December 25, 1640; the great mathematician Pierre de Fermat wrote to Marin...
分类:
其他好文 时间:
2014-09-02 10:35:34
阅读次数:
254