Problems > Look and Say > Editorial

Look and Say — Solution & Editorial

Back to the Problem

Iteratively run-length-describe the previous term. Lengths grow ~30% per step; N ≤ 25 keeps it small.

Complexity: O(output length)