Since we do not need to determine the optimal path or anything, we just keep track of whether we can move one step forward, renewing the "reserved jumps" number if necessary.

```
bool canJump(vector<int>& nums) {
if(nums.empty()) return true;
int m = nums[0];
for(auto i = 1; i < nums.size(); ++i)
{
if(m <= 0) return false;
m = max(m - 1, nums[i]);
}
return true;
}
```