I don't see this solution posted before. Another perspective.

```
class Solution {
public:
bool canJump(vector<int>& nums) {
return canJump(nums, nums.size() - 1);
}
bool canJump(vector<int>& nums, int p) {
if (!p) return true;
int d = 1; // distance to position p
while (p - d >= 0 && nums[p - d] < d) ++d;
if (p - d < 0) return false;
return canJump(nums, p - 1);
}
};
```