Still has O(n) solution.
Need to rethink it
class Solution:
def jump(self, nums: List[int]) -> int:
#TC: O(len(nums)*max(len(nums)))
#SC: O(len(nums))
last = nums[-1]
i = len(nums) - 2
dp = [0]*len(nums)
while i >= 0:
Min = sys.maxsize
for j in range(1, nums[i]+1):
if i + j < len(nums):
Min = min(Min, 1 + dp[i+j])
dp[i] = Min
i -= 1
return dp[0]