Given an array nums where nums[i] is the maximum forward jump length from index i, return the minimum number of jumps to reach the last index starting from index 0. Return -1 if the last index cannot be reached. The input is JSON {nums}.
Input: JSON {nums}.
Output: Integer — minimum jumps, or -1.
Input: {"nums":[2,3,1,1,4]}
Output: 2
Explanation: Jump 0->1->4.Input: {"nums":[0]}
Output: 0
Explanation: Already at the end.Input: {"nums":[1,0,0]}
Output: -1
Explanation: Stuck at index 1, cannot reach the end.1<=n<=10^40<=nums[i]<=1000