r********t 发帖数: 395 | 1 在这个网页里:http://www.careercup.com/question?id=266699
He gave me an array of Integers, each integer allows me to make at max its
value jumps. If i am at zero, i'm stuck i cannot move forword. He asked me
to find the least selection to reach end of the array.
ex: 1 3 5 8 9 2 6 7 6 8 9
initially at one i have only make one jump to 3, from 3 i can jump either 1
step 0r 2 steps 0r 3 steps.
my solution is 1 to 3 to 8, 3 selection and i am done.
Device an algo for this
有一个答案用到动态规划:
It's a dynamic program |
|