Given a 0-indexed array of integers nums where each element represents the maximum length of a forward jump from that index, return the minimum number of jumps to reach the last index.
You can assume that you can always reach the last index.
Example 1:
Input: nums = [2,3,1,1,4]
Output: 2
Explanation: The minimum number of jumps to reach the last index is 2. Jump 1 step from index 0 to 1, then 3 steps to the last index.
Example 2:
Input: nums = [2,3,0,1,4]
Output: 2
Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.
Example 3:
Input: nums = [1,2,3]
Output: 2
Explanation: Jump 1 step from index 0 to 1, then 2 steps to the last index.
1 <= nums.length <= 10^40 <= nums[i] <= 1000nums[n - 1]