class Solution:
def canJump(self, nums: List[int]) -> bool:
#TC: O(len(nums))
#SC: O(1)
last = len(nums) - 1
i = len(nums) - 2
while i >= 0:
if nums[i] + i >= last:
last = i
i -= 1
return last == 0