55. 跳跃游戏
作者:互联网
代码:
class Solution:
def canJump(self, nums: List[int]) -> bool:
max_dis = 0
for inx, value in enumerate(nums):
if max_dis >= inx and inx + value >= max_dis:
max_dis = max(max_dis, inx + value)
return max_dis >= inx
标签:inx,游戏,nums,55,max,value,跳跃,cn,dis 来源: https://blog.csdn.net/wdh315172/article/details/120623574