【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】面试题内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复