Count and Say The count-and-say sequence is the sequence of integers with the first five terms as following: 1 is read off as "one 1" or 11.11 is read ...
分类:
其他好文 时间:
2017-09-28 22:30:00
阅读次数:
168
问题描写叙述: The count-and-say sequence is the sequence of integersbeginning as follows: 1, 11, 21,1211, 111221, ... 1 is read off as "one1" or 11. 11 is r ...
分类:
其他好文 时间:
2017-08-19 22:15:54
阅读次数:
175
思路:首先弄清楚题意,假设要得到第n个数,先要遍历第n-1个数。统计连续出现的数字个数。然后组合个数+数字本身组成新的数,如121121,从第一个数字開始。由于仅仅有一个1。所以,个数为1。和1本身组成1 1。然后一个2,得到 1 2,接下来出现2个1。所以得到 2 1。 最后1 个 2 。1个1 ...
分类:
其他好文 时间:
2017-08-19 18:27:57
阅读次数:
124
The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 1 is read off as "on ...
分类:
其他好文 时间:
2017-07-19 23:32:21
阅读次数:
279
Question: Leedcode提交代码:Runtime: 19 ms 完整可运行代码: 注: ①最开始使用一个String变量ans进行循环,导致每轮次ans之间混乱,加入curr变量,解决这个问题。 ② String与StringBuilder之间的区别: String:字符串常量 Stri ...
分类:
其他好文 时间:
2017-06-27 23:41:41
阅读次数:
381
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1is read off as"one 1"or11.11is read off as"t ...
分类:
其他好文 时间:
2017-06-20 18:13:03
阅读次数:
394
The count-and-say sequence is the sequence of integers with the first five terms as following: 1 is read off as "one 1" or 11.11 is read off as "two 1 ...
分类:
其他好文 时间:
2017-06-14 20:09:32
阅读次数:
207
https://leetcode.com/problems/count-and-say/#/description The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, ...
分类:
其他好文 时间:
2017-06-06 22:01:16
阅读次数:
142
The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read o ...
分类:
其他好文 时间:
2017-04-25 22:22:48
阅读次数:
110
class Solution { public: string countAndSay(int n) { string ret = "1"; for(int i=1; i<n; ++i) ret = generateNext(ret); return ret; } string genera... ...
分类:
其他好文 时间:
2017-04-23 13:15:51
阅读次数:
152