TOPIC

15%wrong ans in python

nameless55 asked 7 months ago

a = list(map(int, input().split()))
frog_jump_height = a[0]
last_value = a[1]-1
pipes = list(map(int, input().split()))
ans = "YOU WIN"
pipe_height = 0
for i in pipes:
    if pipes.index(i) == last_value and i == pipes[-1]:
        break
    else:
        pipe_height = i - pipes[pipes.index(i)+1]

        if abs(pipe_height)>frog_jump_height:
            ans = "GAME OVER"
            break
print(ans)

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.