Back to problems

Bitfront

Algorithm · Stripe · Medium

You are given a list of non-negative integers. Each value specifies the farthest distance you may jump forward from that index. Determine the smallest number of jumps required to arrive at the final index. Example: Input: [3,2,1,0,4] Output: 3 Explanation: Move from index 0 to index 1, then jump from index 1 to index 3, and finally jump to the last position. Input: [1,4,0,0,2] Output: 2 You may assume that reaching the last index is always possible. Example

Checking your access…