leetcode-面试题-16.11-跳水板
题目描述:
提交:O(n)
class Solution: def divingBoard(self, shorter: int, longer: int, k: int) -> List[int]: if k == 0: return [] res = [] for i in range(k,-1,-1): num = i*shorter+(k-i)*longer if res and num == res[-1]: continue res.append(num) return res