Problem 3942 · Medium

Minimum Operations to Sort a Permutation

Search arrangements reachable by reversing the whole array or rotating it left. The first time sorted order appears, its depth is the answer.

Open the interactive visualisation