Skip to content
CodeItRaw
Code Reading
/
Jump Game
Path
Play
Daily
Leaderboard
tr
Bug Hunt
Jump Game
jumps[i] is how far you may jump from i. Can you reach the end? It should be True for [2, 0, 0] but returns False. Find the line and the kind of bug.
Click the line you think is wrong.
1
def
can_reach_end
(jumps):
2
reach =
0
3
for
i, j
in
enumerate
(jumps):
4
if
i > reach:
5
return
False
6
reach =
max
(reach, j)
7
return
True