```
public boolean canJump(int[] nums) {
int l=nums.length;
if (l<=1)
return true;
int n=0;
while(nums[n]+n+1<l){
n+=nums[n];
if(nums[n]==0){
int k = n;
while(n+nums[n]<=k)
if(--n < 0)
return false;
}
}
return true;
}
```

We have to do backward searching only if we jumped to 0.