Given an array of non-negative numbers, and you are positioned at the first element.
You are allowed to make number of jumps that's smaller than or equal to the value at your position in the array.
Determine whether we can reach the end of the array or not.
3 4 0 0 0 1
should return True
4 3 2 1 0 1
should return False
This problem can be solved using the greedy approach.
We can traverse all the elements 1 by 1, starting from the first element that are reachable.
For this, we keep track of a variable reach that stores the maximum distance that is reachable so far.