题目:https://leetcode.com/problems/Count-and-Say/
代码(github):https://github.com/illuz/leetcode
数数,第一个是 1,第二个是数前一个数:1 个 1,就是 11,第三个是 2 个 1,就是 21,第三个是 1 个 2,1 个 1,就是 1211,第四个是 111221... 现在问第 n 个数是什么。
可以直接模拟,一个个数过去。
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
题目:https://leetcode.com/problems/Count-and-Say/
代码(github):https://github.com/illuz/leetcode
数数,第一个是 1,第二个是数前一个数:1 个 1,就是 11,第三个是 2 个 1,就是 21,第三个是 1 个 2,1 个 1,就是 1211,第四个是 111221... 现在问第 n 个数是什么。
可以直接模拟,一个个数过去。