维护终点end
bool canJump(int* nums, int numsSize){
int max=numsSize-2,end=numsSize-1;
while(max>=0){
if(nums[max]>=end-max)
end=max;
max-=1;
}
return end?0:1;
}
维护终点end
bool canJump(int* nums, int numsSize){
int max=numsSize-2,end=numsSize-1;
while(max>=0){
if(nums[max]>=end-max)
end=max;
max-=1;
}
return end?0:1;
}