510. Jump Game II
Given an array of non-negative integers arr, a monkey starts at the first index of the array. Each element in the array arr[i] represents the maximum length of a forward jump from index i. The monkey wants to reach the last index in the minimum number of jumps. Help the monkey find the minimum number of jumps required to reach the last index. It is guaranteed that the monkey can always reach the last index.
The first line of input should contain an integer N, the size of the array. The second line should contain N integers, representing the elements of the array.
Print the minimum number of jumps the monkey needs to reach the last index.
5 2 3 1 1 4