```
public static boolean canJump(int[] nums) {
int i=0,len=nums.length;
while(i<len){
if(i==len-1){
return true;
}
if(nums[i]==0){
return false;
}
i+=nums[i];
}
return false;
}
```

## doesn't it a o(n) time solution?

I had misunderstood this question

............................