Go Array Change
func arrayChange(a []int) int {
moves := 0
for k := 0; k < len(a)-1; k++ {
if a[k] >= a[k+1] {
diff := a[k] - a[k+1] + 1
a[k+1] += diff
moves += diff
}
}
return moves
}
This moves left to right and bumps values only when needed so the array becomes strictly increasing.