Minimum Array Changes to Make Differences Equal
Pair the outer and inner positions, then try every common difference and count the cheapest change per pair.
Pair the outer and inner positions, then try every common difference and count the cheapest change per pair.