Unstub

Run-length encodingMedium

Count and Say

The first term is "1". Each next term reads the one before aloud, run by run, as the run's length and then its digit, so "1" gives "11" and "11" gives "21". Return the nth term.

Aim for O(n · L) time, where L is the length of the longest termInspired by a classic interview problem ↗