'''You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.

Return true if you can reach the last index, or false otherwise.'''

class Solution:
    def canJump(self, nums: List[int]) -> bool:

        reachable = [False for _ in range(len(nums))]

        reachable[0] = True

        for i in range(len(nums)):
            for j in range(i-1,-1,-1):
                reachable[i] = (reachable[j] and (nums[j] + j >= i))
                if reachable[i]:
                    break

        return reachable[len(nums)-1]
