AI Interview Prep is optimized for larger screens
Please open this on a laptop or desktop (1024px and wider) to use the full editor, whiteboard, and AI coaching surface.
Understand the problem
Restate the problem precisely. Interviewers reward candidates who pause, define the contract, and name the guarantees before coding.
You are given a 0-indexed array of integers `nums` of length `n`. You are initially positioned at `nums[0]`. Each element `nums[i]` represents the maximum length of a forward jump from index `i`. You can jump from `i` to any index in the range `[i + 1, i + nums[i]]`. Return the minimum number of jumps to reach `nums[n - 1]`. The test cases are generated such that you can reach `nums[n - 1]`.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.