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.
Track the fewest replacements for each possible last value, and replace only with the smallest larger value from the sorted second array.