We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5141006 commit ae8924cCopy full SHA for ae8924c
Program/Jump Game Leetcode Problem.py
@@ -0,0 +1,7 @@
1
+class Solution:
2
+ def canJump(self, nums: List[int]) -> bool:
3
+ goal = len(nums) - 1
4
+ for i in range(len(nums)-1,-1,-1):
5
+ if i + nums[i] >= goal:
6
+ goal = i
7
+ return goal == 0
0 commit comments