多彩编程 多彩编程MZPH · CODE BLOG
ARTICLE DETAIL

文章详情

深耕前端与后端开发技术的一线实战笔记与踩坑复盘。

二刷hot100-55.跳跃游戏

二刷hot100-55.跳跃游戏 很巧妙不去管某一个位置点而是求取过程中最远覆盖面若是覆盖到最后一个元素则返回trueclass Solution { public boolean canJump(int[] nums) { int cover 0; for(int i 0;i cover;i){ cover Math.max(cover,i nums[i]); if(cover nums.length - 1){ return true; } } return false; } }
返回列表