Created
January 11, 2021 08:07
-
-
Save ceth-x86/f3bae7a6065013e687145c3aefa825d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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