The idea is to calculate maximum reach for every index. If the maxReach couldn't move forward more than current index, we think we can't reach the end, can we? If maxReach reaches the end, it is done.

```
public class Solution {
public boolean canJump(int[] nums) {
int maxReach = 0;
for (int i = 0; i < nums.length-1; i++) {
maxReach = Math.max(maxReach, nums[i] + i);
if (maxReach <= i) return false;
if (maxReach >= nums.length-1) return true;
}
return true;
}
}
```