```
class Solution {
public:
bool canJump(vector<int>& nums) {
int n = nums.size();
int bound = nums.size()-1;
for(int i=n-2;i>=0;--i)
if(nums[i]+i>=bound) bound = i;
if(bound == 0) return true;
return false;
}
};
```