Count and Say
Problem statement
The count-and-say sequence begins with countAndSay(1) = "1". Each later term describes the maximal equal-digit runs of the previous term as count followed by digit.
Return the n-th term.
Function
countAndSay(n: int) → StringExamples
Example 1
n = 1return = "1"The first term is defined as 1.
Example 2
n = 4return = "1211"Term 3 is 21, which is read as one 2 and one 1.
Constraints
1 <= n <= 30.