我是靠谱客的博主 健康月饼,这篇文章主要介绍【leetcode-python-29】面试题 16.11. 跳水板渣渣原始版(85.71%),现在分享给大家,希望可以做个参考。

【leetcode-python-29】面试题 16.11. 跳水板

  • 渣渣原始版(85.71%)

leetcode 面试题 16.11. 跳水板

渣渣原始版(85.71%)

直接用range方法。

class Solution(object):
def divingBoard(self, shorter, longer, k):
"""
:type shorter: int
:type longer: int
:type k: int
:rtype: List[int]
"""
if not k:
return []
if shorter == longer:
return [shorter*k]
return range(shorter * k, longer * k + 1, longer - shorter)

新手入坑,多多包涵~~

最后

以上就是健康月饼最近收集整理的关于【leetcode-python-29】面试题 16.11. 跳水板渣渣原始版(85.71%)的全部内容,更多相关【leetcode-python-29】面试题内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(38)

评论列表共有 0 条评论

立即
投稿
返回
顶部