<p>You are given an integer array <code>nums</code>. You are initially positioned at the array&#39;s <strong>first index</strong>, and each element in the array represents your maximum jump length at that position.</p>

<p>Return <code>true</code><em> if you can reach the last index, or </em><code>false</code><em> otherwise</em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> nums = [2,3,1,1,4]
<strong>Output:</strong> true
<strong>Explanation:</strong> Jump 1 step from index 0 to 1, then 3 steps to the last index.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> nums = [3,2,1,0,4]
<strong>Output:</strong> false
<strong>Explanation:</strong> You will always arrive at index 3 no matter what. Its maximum jump length is 0, which makes it impossible to reach the last index.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= nums.length &lt;= 10<sup>4</sup></code></li>
	<li><code>0 &lt;= nums[i] &lt;= 10<sup>5</sup></code></li>
</ul>

class Solution:
    def canJump(self, nums: List[int]) -> bool:
        len_nums = len(nums)
        if len_nums == 1:
            return True
        elif nums[0] == 0:
            return False
        elif nums[0] >= len_nums-1:
            return True
        elif 0 not in nums:
            return True
        
        nums.reverse()

        max_jumps = [0]
        for index_i in range(1,len_nums):
            i = nums[index_i]
            if i == 0:
                max_jumps += [max_jumps[-1]]
            elif index_i <= i:
                jumps = max_jumps[0:index_i]
                additions = range(index_i,0,-1)
                new_jumps = [a + b for a, b in zip(jumps, additions)]
                max_jumps += [max(new_jumps)]
            else:
                jumps = max_jumps[index_i-i:index_i]
                additions = list(range(i,0,-1))
                new_jumps = [a + b for a, b in zip(jumps, additions)]
                max_jumps += [max(new_jumps)]
        
        if max_jumps[-1] >= len(nums) -1:
            return True
        else:
            return False
19100