Your question is Minimum Jumps to Reach End. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an integer array nums where nums[i] is the maximum jump length from index i, return the minimum number of jumps needed to reach the last index starting from index 0. If the last index cannot be reached, return -1.
def min_jumps(nums):