Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def arrayChange(inputArray):
- x = 1
- moves = 0
- while x < len(inputArray):
- if inputArray[x] <= inputArray[x - 1]:
- moves = moves + abs(inputArray[x] - inputArray[x - 1]) + 1
- inputArray[x] = inputArray[x - 1] + 1
- x = x + 1
- return moves
Advertisement
Add Comment
Please, Sign In to add comment