Skip to content

Commit e09ee16

Browse files
authored
Create 55-Jump-Game.py
1 parent f361489 commit e09ee16

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

55-Jump-Game.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def canJump(self, nums: List[int]) -> bool:
3+
goal = len(nums) -1
4+
5+
for i in range(len(nums) - 2, -1, -1):
6+
if i + nums[i] >= goal:
7+
goal = i
8+
return True if goal == 0 else False

0 commit comments

Comments
 (0)