What is the difference between DP and Greedy? My observation is that Greedy directly compares the two indices by looking forward, while DP monitors the difference of two indices by looking backward.

```
bool canJump(vector<int>& nums) {
int maxSteps=0; // maxSteps defines the maximum steps we just still jump at index i
for (int i=0; i<nums.size(); i++) {
maxSteps = max(maxSteps-1, nums[i]);
if (maxSteps == 0) return false;
}
return true;
}
```