Skip to content

Latest commit

 

History

History

challenge-63

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Jump to the end

This problem was asked by Facebook.

Description

Starting at index 0, for an element n at index i, you are allowed to jump at most n indexes ahead.

Given a list of numbers, find the minimum number of jumps to reach the end of the list.

Example

Input:
  Input: [3, 2, 5, 1, 1, 9, 3, 4]
  Output: 2 (3 -> 5 -> 4)