Sweet and Simple Solution

programming
amazon
interview-questions
Tags: #<Tag:0x00007f1828478fc8> #<Tag:0x00007f1828478780> #<Tag:0x00007f182847fcd8>

#1

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