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"tw...
分类:
其他好文 时间:
2014-06-10 10:41:04
阅读次数:
147
题目链接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 a...
分类:
其他好文 时间:
2014-06-09 15:53:03
阅读次数:
246
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"tw...
分类:
其他好文 时间:
2014-06-06 19:53:31
阅读次数:
203
水题。描写叙述的还挺麻烦的,实际上就是纸老虎,用两个string,一个存上一轮的结果,一个用来更新出这一轮的结果,每次扫描上一轮,统计一个字符出现的次数,然后把这个次数和字符增加到这一轮的字符串中就能够了。class
Solution {public: string countAndSay(i...
分类:
其他好文 时间:
2014-06-05 18:34:43
阅读次数:
204
【题目】
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 off as "two 1s" or 21.
21 is read off as "one 2, then one 1" or 1211.
Given an integer n, generate...
分类:
其他好文 时间:
2014-05-21 15:20:07
阅读次数:
213
一次过 1 public class Solution { 2 public String
countAndSay(int n) { 3 if (n <= 0) return ""; 4 int i = 1; 5 String current
...
分类:
其他好文 时间:
2014-05-16 21:27:59
阅读次数:
267
水题。
描述的还挺麻烦的,实际上就是纸老虎,用两个string,一个存上一轮的结果,一个用来更新出这一轮的结果,每次扫描上一轮,统计一个字符出现的次数,然后把这个次数和字符加入到这一轮的字符串中就可以了。
class Solution {
public:
string countAndSay(int n) {
if(n == 0) return "";
...
分类:
其他好文 时间:
2014-05-15 04:12:07
阅读次数:
289