Start with an array A of positive numbers. Start at index 0. From index i, you can move to index i+x for any x <= A[i]. The goal is to find the minimum number of moves needed
My naive approach - going from the start, doing breath-first through all paths ( child nodes are A[i+1] .. A[i+n] ), saving found paths yo some array and then get the shortest paths. Of course all indexes i+n > length(A) are discarded. So it's upper bound is O(n*min(n,max(A[i=0..n])) + n) - in should less than quadratic in practice.