LeetCode(力扣)55. 跳跃游戏Python

LeetCode20. 有效的括号

题目链接

https://leetcode.cn/problems/jump-game/

代码

python 复制代码
class Solution:
    def canJump(self, nums: List[int]) -> bool:
        if len(nums) <= 1:
            return True
        cover = 0
        for i in range(len(nums)):
            if i <= cover:
                cover = max(cover, i + nums[i])
                if cover >= len(nums) - 1:
                    return True
        return False
相关推荐
2601_962300813 小时前
机器学习贴士:使用Python编写MapReduce
hadoop·python·机器学习·mapreduce·数据处理
xyz_CDragon4 小时前
GitHub上4个爆款AI开源Skill:拍照后不用P图,用Codex一键生成高级海报(附效果图+使用教程)
人工智能·python·github·codex·skill
weixin199701080164 小时前
[特殊字符]《跨境二手ERP对接Back Market:标准化API + 7~10工作日技术合规审核实录》(附Python源码)
开发语言·python·pandas
持敬chijing5 小时前
Python-数据类型-列表
开发语言·python·青少年编程
笨鸟先飞的橘猫5 小时前
系统设计第十七天决策卡
学习·游戏
2601_962301015 小时前
Python环境搭建及PyCharm破解使用技巧
python·pycharm·环境搭建·避坑技巧·破解使用
Navigator_Z6 小时前
LeetCode //C - 1240. Tiling a Rectangle with the Fewest Squares
c语言·算法·leetcode
稻米哟6 小时前
力扣100——双指针
算法·leetcode
一孤程6 小时前
游戏测试专题第二篇:游戏功能测试与用例设计实战
功能测试·游戏·测试·测试覆盖率
2601_962099467 小时前
Python中的find()函数:用法和示例
python·字符串·索引·子字符串·find函数