Problem 880 · Medium
Track the decoded length without expanding, then unwind backwards reducing k modulo the length.
Open the interactive visualisation