也许算是dp把- -
class Solution {
public:
bool canJump(int A[], int n) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int last = n - 1;
for(int i = n - 2; i >= 0; -- i){
if(i + A[i] >= last )
last = i;
}
return last == 0;
}
};