标签:
public class Solution { public boolean canJump(int[] nums) { if (nums == null || nums.length == 0) { return false; } int reach = 0; for (int i = 0; i <= reach && i < nums.length; i++) { reach = Math.max(nums[i] + i, reach); } if (reach < nums.length - 1) { return false; } return true; } }
标签:
原文地址:http://www.cnblogs.com/77rousongpai/p/4534959.html