1.从后到前,每次找出到最后位置最远的位置(最好理解。。。)直到当前的最后位置就是0结束。每次找到一个就step++

2.从前到后,每次找能跳的范围内的能跳的最远的位置。。。但是这种方法有个例子[10,9,8,7,6,5,4,3,2,1,1,0]这样就要跑好几次,,第一次选9,第二次选8.。。。。

 

 1 class Solution {
 2     public int jump(int[] nums) {
 3         int position = nums.length - 1;
 4         int steps = 0;
 5         while (position > 0) {
 6             for (int i = 0; i < position; i++) {
 7                 if (i + nums[i] >= position) {
 8                     position = i;
 9                     steps++;
10                     break;
11                 }
12             }
13         }
14         return steps;
15     }
16 }