As reported: Walmart SWE3 round 1 (Apr 2025): Jump Game, then Jump Game II, then moving all zeros to the right.
Given nums where nums[i] is the maximum jump length from index i, return the minimum number of jumps to reach the last index from index 0. The last index is always reachable.
This is LeetCode 45 — Jump Game II.
Example
[2,3,1,1,4] -> 2 (0 → 1 → 4)
[2,3,0,1,4] -> 2
Constraints: 1 ≤ nums.length ≤ 10^4; 0 ≤ nums[i] ≤ 1000; the last index is reachable.
Code runner format: one line with nums. Implement jump(nums); the harness prints the count.