外观数列 题目地址:https://leetcode-cn.com/problems/count-and-say/ 给定一个正整数 n ,输出外观数列的第 n 项。 「外观数列」是一个整数序列,从数字 1 开始,序列中的每一项都是对前一项的描述。 你可以将其视作是由递归公式定义的数字字符串序列: c ...
分类:
编程语言 时间:
2020-12-21 12:14:11
阅读次数:
0
Count and Say (E) 题目 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 ...
分类:
其他好文 时间:
2020-06-27 10:01:45
阅读次数:
74
解法一: class Solution { public: string countAndSay(int n) { char ch[] = {'0', '1', '2', '3'}; string s = "1"; string temp; int cnt = 1; //出现次数 for (int ...
分类:
其他好文 时间:
2020-05-25 12:12:35
阅读次数:
51
Dec 9, 2019 ~ Dec 15, 2019 Algorithm Problem 38.Count And Say 外观数列 "题目链接" 题目描述: 外观数列 是一个整数序列,从数字 1 开始,序列中的每一项都是对前一项的描述。前六项及其说明如下: 1. 1 // base 2. 11 / ...
分类:
其他好文 时间:
2020-02-09 20:25:50
阅读次数:
66
读题: 个人感觉这题的难点就是读题了,count-and-say,给出了前5个的例子 初始从1开始,读作“1个1”,即11 接着读11,读作“2个1”,即21 接着读21,读作“1个2,1个1”,即1211 接着读1211,读作“1个1,1个2,2个1”,即111221 如果能读明白题,就基本解得出 ...
分类:
其他好文 时间:
2019-11-09 09:49:56
阅读次数:
113
题目描述: 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 ...
分类:
其他好文 时间:
2019-11-02 17:33:40
阅读次数:
78
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 ...
分类:
其他好文 时间:
2019-10-19 20:30:16
阅读次数:
105
Difficulty:easy More:【目录】LeetCode Java实现 Description https://leetcode.com/problems/count-and-say/ The count-and-say sequence is the sequence of intege ...
分类:
其他好文 时间:
2019-10-13 13:09:27
阅读次数:
85
public String countAndSay(int n) { String arr[] = new String[n + 1]; arr[1] = 1 + ""; for(int i = 2; i ...
分类:
其他好文 时间:
2019-08-06 01:02:39
阅读次数:
216
"题目" c++ class Solution { public: string a[31]; string countAndSay(int n) { a[1]="1"; for(int i=2;i ...
分类:
其他好文 时间:
2019-08-03 14:36:59
阅读次数:
87