Single Java Solution


  • 0
    L

    public class Solution {
    public boolean canJump(int[] nums) {
    int current = nums[0];
    for (int i = 1; i < nums.length; i++){
    current --;
    if (current < 0) return false;
    if (current < nums[i]) current = nums[i];
    }
    return true;
    }
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.