Problem 1187 · Hard

Make Array Strictly Increasing

Track the fewest replacements for each possible last value, and replace only with the smallest larger value from the sorted second array.

Open the interactive visualisation