Easy Python Solution - Linear

  • 0
    class Solution(object):
        def canJump(self, nums):
            :type nums: List[int]
            :rtype: bool
            if nums==None or nums==[] or nums[0]==0 and len(nums)>1:
                return False
            for i in range(len(nums)):
                if far>=len(nums)-1:
                    return True
                if i<=far:
            return False

    For simplicity, some overlapping cases are not removed.

Log in to reply

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