0031. Next Permutation

Find the next lexicographically greater permutation of an array

Scanning
Descending suffix
Pivot
Swap target
Swapped
Reversing
Done
Click "Step" or "Play" to begin
Speed: 800ms
Ready. Load an array and click Step or Play.
Result