Let's have a list of positive integers
this will represent a river. We would like to skip a stone across this river. We can throw the stone as far as we want and whatever number it lands on it will skip that many places. So if we start by throwing it 2 spaces, it will land on the
1 skip forward one place, land on the
9 skip forward 9 places, land on the final 6 and skip out of the river.
[6,1,9,3,7,4,6,3,2,7,6,6] ^ [6,1,9,3,7,4,6,3,2,7,6,6] ^ [6,1,9,3,7,4,6,3,2,7,6,6] ^
The question for us is: "How do we throw the stone so it skips the largest number of times?" In the above case
2 skips 3 times and indeed we can see that this is the optimum.
Here's all the ways to throw the stone with the number of skips labeled:
[6,1,9,3,7,4,6,3,2,7,6,6] 2 3 2 2 2 2 1 2 2 1 1 1
Given a list of positive integers as input output the maximum skips that can be achieved on that river.
This is code-golf so the goal is to make your source code as small as possible as measured in bytes.
 -> 1 [1,1,1] -> 3 [9,1,1,1] -> 3 [9,3,1,2,2,9,1,1,1] -> 5 [6,6] -> 1 [6,1,9,3,7,4,6,3,2,7,6,6] -> 3 [1,1,9,1,1] -> 3