Problem can be done without DP


#1

int Solution::canJump(vector &A) {

if(A.size()==0) return 1;
int maxreach = A[0];

for(int i=0;i<=maxreach;i++){
    
    if(maxreach>=A.size()-1) return 1;
    if(i+A[i]>maxreach) maxreach = i+A[i];
    
}
return 0;

}