← 返回 doordash 的题目列表Count and Say
类型:online_judge
Problem Description: Implement a function to generate the "count and say" sequence. Given an integer n, generate the nth term of the sequence. The first few terms of the sequence are:
1
11
21
1211
111221
Where each term is a count of the previous term. The first term is 1, and each successive term describes the count of the previous term's digits.
For example, "21" describes "two 1s."
Input:
An integer n, 1 <= n <= 30.
Output:
The string representation of the nth term.
Example
Input
1
Output
1