Problem 626 · Medium

Exchange Seats

Swap each adjacent pair of student seats, leaving the last seat alone when the count is odd. The visual shows arrows between neighbouring seats and their new occupants.

Open the interactive visualisation