Tree Lines O(n) Solution in Java


  • 0
    C

    int end = 0, index = -1;
    while(++index <= end && index < nums.length) end = Math.max(end, index + nums[index]);
    return index==nums.length;


Log in to reply
 

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