mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 02:53:31 +08:00
Update 0055.跳跃游戏.md
python for循环版,添加了更新cover的条件
This commit is contained in:
@ -126,6 +126,7 @@ class Solution:
|
||||
cover = 0
|
||||
if len(nums) == 1: return True
|
||||
for i in range(len(nums)):
|
||||
if i <= cover:
|
||||
cover = max(i + nums[i], cover)
|
||||
if cover >= len(nums) - 1: return True
|
||||
return False
|
||||
|
Reference in New Issue
Block a user