Total Accepted: 72708
Total Submissions: 258534
Difficulty: Easy
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 the _n_th sequence.
Note: The sequence of integers will be represented as a string.
Java:
1 | public class Solution { |
当然我采用了打表法beats 100% Java submition
1 | public class Solution { |