Given an array nums where nums[i] is the maximum jump length from index i (assume the last index is always reachable), return the minimum number of jumps to reach the last index from index 0. The input is JSON {nums}.
Input: JSON {nums}.
Output: Integer — the minimum number of jumps.
Input: {"nums":[2,3,1,1,4]}
Output: 2
Explanation: Jump to index 1, then to the end.Input: {"nums":[2,3,0,1,4]}
Output: 2
Explanation: Two jumps suffice.Input: {"nums":[0]}
Output: 0
Explanation: Already at the end.1<=n<=10^40<=nums[i]<=1000