Problem 3694 · Medium

Distinct Points Reachable After Substring Removal

After removing a window, the final point is the prefix before the window plus the moves after it, so prefix positions give every endpoint without replaying.

Open the interactive visualisation