def compute_min_moves(towers, moves = 0):
# Si 0 o 1 torre, no se hace nada
if len(towers) < 2:
return moves
for i in range(len(towers)-1, 0 ,-1):
if towers[i - 1] < towers[i]:
diff = 0
while towers[i - 1] < towers[i]:
diff += 1
towers[i - 1] += diff
towers[i] -= diff
moves += diff
sub_array = towers[i-1:]
if not all(earlier >= later for earlier, later in zip(sub_array, sub_array[1:])):
moves = compute_min_moves(towers, moves)
return moves