class Solution:
def canJump(self, nums: List[int]) -> bool:
max_position, last_position = 0, len(nums) - 1
for i, v in enumerate(nums):
if i > max_position:
return False
if max_position >= last_position:
return True
max_position = max(max_position, i+v)
return True
DP 싫어요