class Solution {
public boolean canJump(int[] nums) {
int n=nums.length;
int most=0;
for(int i=0;i<n;i++){
if(i>most)return false;
most=Math.max(most,i+nums[i]);
}
return true;
}
}
跳跃游戏贪心
最新推荐文章于 2025-12-26 16:25:00 发布

638

被折叠的 条评论
为什么被折叠?



