首页
Java
登录
6mi
u
盘
搜
搜 索
Java
55. Jump Game
55. Jump Game
xiaoxiao
2021-02-27
121
class Solution(object): def canJump(self, nums): """ :type nums: List[int] :rtype: bool """ m = 0 for i, n in enumerate(nums): if i > m: return False m = max(m, i+n)
return True
https://discuss.leetcode.com/topic/16704/1-6-lines-o-n-time-o-1-space
转载请注明原文地址: https://www.6miu.com/read-16307.html
技术
最新回复
(
0
)