Just Few lines in cpp


#1

int Solution::canJump(vector &A) {
int max_reach = A[0];
for(int i = 1;i<A.size();i++){
if(max_reach<i)return 0;
max_reach = max(max_reach,i+A[i]);
}
return 1;
}