Only one pass. O(n) time O(1) memory.

public class Solution {

```
public int jump(int[] A) {
if (A == null || A.length <= 1) {
return 0;
}
int tail = A[0];
int min = 1;
int begin = 0;
while (tail < A.length - 1) {
int maxPace = 0;
for (int i = begin ; i <= tail; i++) {
maxPace = Math.max(maxPace, i + A[i]);
}
begin = tail + 1;
tail = Math.max(tail, maxPace);
min++;
}
return min;
}
```

}