Skip to content

Instantly share code, notes, and snippets.

@ceth-x86
Created January 11, 2021 08:07
Show Gist options
  • Save ceth-x86/f3bae7a6065013e687145c3aefa825d3 to your computer and use it in GitHub Desktop.
Save ceth-x86/f3bae7a6065013e687145c3aefa825d3 to your computer and use it in GitHub Desktop.
class Solution:
def canJump(self, nums: List[int]) -> bool:
last_position = len(nums)-1
for i in range(len(nums)-2,-1,-1): item
if (i + nums[i]) >= last_position:the last position
last_position = i
return last_position == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment