LeetCode Top 150 Interview Questions-Medium level-#55 Jump Game-Java Python Solutions-TC:O(N) SC:O(1)
Intuition
Check if current index is further than reach
Approach
Init reach to be 0 - Loop through nums
Check if index>reach
If so, return false - Update reach to be the max between (i+nums[i], reach) - Return true
Complexity
Time complexity: O(...
huanganni.hashnode.dev1 min read