Look and Say — Solution & Editorial
Iteratively run-length-describe the previous term. Lengths grow ~30% per step; N ≤ 25 keeps it small.
Complexity: O(output length)
Iteratively run-length-describe the previous term. Lengths grow ~30% per step; N ≤ 25 keeps it small.
Complexity: O(output length)