LI@NG

Leetcode 55 Jump Game

https://leetcode.com/problems/jump-game

贪心,找到每个所在元素的最大可及idx

var canJump = function(nums) {
	let max = 0;
	for (let idx = 0; idx < nums.length; idx++) {
		if (idx > max) return false;
		max = Math.max(max, idx + nums[idx]);
	}
	return true;
};