The count-and-say sequence is a list of strings of digits. Term 1 is "1". Each next term describes the previous one by reading its runs of equal digits aloud: how many, then which digit.
"1"1, so "11"1s, so "21"2, one 1, so "1211"1, one 2, two 1s, so "111221"Return term n.
Example 1
Input:
count_and_say(4)
Output:
'1211'
Example 2
Input:
count_and_say(1)
Output:
'1'
1 <= n <= 40No results yet
Run your code to check it against the examples, or submit to run every test.