5 line... easy to understand greedy


#1

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

}