Problem 2717 · Easy

Semi-Ordered Permutation

Move 1 to the front and n to the back with adjacent swaps, sharing one swap when 1 sits after n.

Open the interactive visualisation