Untitled

Anonymous
plain_text
03/31/2025 11:40 PM
504 B
19
Indexable
class Solution:
    def canJump(self, nums: List[int]) -> bool:
        max_reach = nums[0]
        for i in range(len(nums)) :
            if max_reach < i :
                return False 
            iter_reach=i+nums[i]
            max_reach = max(max_reach,iter_reach)
            if max_reach >= len(nums)-1 :
                return True
        return False

Editor is loading...
Leave a Comment