1
# Runtime: 1132 ms (Top 16.52%) | Memory: 15.2 MB (Top 81.46%)3
def canJump(self, nums: List[int]) -> bool:5
# Memoization + DFS Solution6
# TLE as we have as much as n decisions depending on nums[i] which could be7
# 10^5 as an uppercase according to problem constraints8
# better off with a greedy approach19
for j in range(1, nums[i] + 1):30
# Key with greedy is to find a local and gobal optimum31
# here we find the furthest distance we can travel with each index33
# futhest index reachable36
# iterate through all indexes and if the current index is futher than what we can travel return fasle37
for i in range(len(nums)):41
reachable = max(reachable, nums[i] + i)42
# if the futherest distance we can jump to is greater or equal than the last index break43
if reachable >= len(nums) - 1: