Problem 2766 · Medium

Relocate Marbles

Keep the occupied positions in a hash set; each move removes its source position and adds its destination.

Open the interactive visualisation