Find minimum number of jumps to reach last index (always reachable).

Input: nums=[2,3,1,1,4] → Output: 2. Jump 1->3->4. Input: nums=[2,3,0,1,4] → Output: 2

BFS-like greedy: track current level end and farthest reachable. When we pass level end, increment jumps.

public int jump(int[] nums) { int jumps = 0, curEnd = 0, farthest = 0; for (int i = 0; i < nums.length - 1; i++) { farthest = Math.max(farthest, i + nums[i]); if (i == curEnd) { jumps++; curEnd = farthest; } } return jumps; }