Given an array nums where nums[i] is the maximum forward jump from index i, return the minimum number of jumps to reach the last index from index 0, or -1 if it is unreachable. The input is JSON {nums}.
Input: JSON {nums}.
Output: Integer — the minimum jumps, or -1.
Input: {"nums":[2,3,1,1,4]}
Output: 2
Explanation: Jump to index 1, then the end.Input: {"nums":[3,2,1,0,4]}
Output: -1
Explanation: Blocked by the 0.Input: {"nums":[0]}
Output: 0
Explanation: Already at the end.1<=n<=1000