Problem 2366 · Hard

Minimum Replacements to Sort the Array

Scan from the right and split each value into as few parts as possible, keeping its smallest part as large as allowed.

Open the interactive visualisation