Ezvor

3431. Minimum Unlocked Indices to Sort Nums

MediumArray Preparing judge… LeetCode
ArrayHash Table

Hints

Hint 1
All positions between the first 2 and the last 1 should be unlocked.
Hint 2
All positions between the first 3 and the last 2 should be unlocked.
Hint 3
If the position of the first 3 is less than the position of the last 1, the answer is -1.