Problem 769 · Medium

Max Chunks To Make Sorted

In a permutation of 0..n-1, cut wherever the prefix maximum equals the index.

Open the interactive visualisation