Problem 3028 · Easy

Ant on the Boundary

Track the running position and count how often the prefix sum returns to the boundary.

Open the interactive visualisation