public boolean canJump(int[] A) {
int max = 0;
for(int i=0;i<A.length;i++){
if(i>max) {return false;}
max = Math.max(A[i]+i,max);
}
return true;
}
Java Solution easy to understand

The loop will stop when max cannot reach cur or max can reach the last index.
public class Solution { public boolean canJump(int[] nums) { int max = 0, length = nums.length; for(int cur = 0; cur <= max && max < length  1; max = Math.max(cur + nums[cur], max), cur++); return max >= length  1; } }

@xniu said in Java Solution easy to understand:
public boolean canJump(int[] A) {
int max = 0;
for(int i=0;i<A.length;i++){
if(i>max) {return false;}
max = Math.max(A[i]+i,max);
}
return true;
}Get it,Thanks. the "max" mean the farthest distance that can be reached currently,right?

I don't think that solution works. I'm not sure if the problem definition changed, but I made a modification and it works fine.
public static bool CanJump(int[] nums) { int max = 0; for (int i = 0; i < nums.Length;i++){ if (i > max) return false; max = Math.Max(nums[i]+i, max); } return true; }