Problem editorialhard
Max chunks to make it sorted
Do not simulate sorting every partition. Ask the sharper question: where can you cut so that nothing ever needs to cross the line?
16 min read·time O(N)·space O(N)
Prefix maxSuffix minSafe boundary
Do not simulate sorting every partition. Ask the sharper question: where can you cut so that nothing ever needs to cross the line?