Difficulty:
The look-and-say sequence is the sequence of numbers generated by describing each number to produce the next. The first few numbers are
1
,11
,21
,1211
, and111221
. The next number in the sequence is312211
, because the last one has "Three 1s, two 2s, and one 1". Givenn
, produce the n-th number in the sequence. The output will not be longer than 20,000 characters.
lookAndSay(7);
"13112221"