摘要: 分析: 大概意思就是需要间隔一个才能再次预约,然后取最大时间 代码: 1 class Solution(object): 2 def massage(self, nums): 3 """ 4 :type nums: List[int] 5 :rtype: int 6 """ 7 n = len(nu 阅读全文
posted @ 2023-04-26 20:35 猥琐丑八怪 阅读(14) 评论(0) 推荐(0)
摘要: 分析; 跟上道题一样,只不过变成了前三个状态的和 直接给出代码,一次性过 代码: 1 class Solution(object): 2 def tribonacci(self, n): 3 """ 4 :type n: int 5 :rtype: int 6 """ 7 if n==0: 8 re 阅读全文
posted @ 2023-04-26 20:25 猥琐丑八怪 阅读(16) 评论(0) 推荐(0)
摘要: 分析: 简单动态规划,状态转移已经给出 直接写代码 但是出了一个小问题,由于粗心,这题是从0算起,到n 我给的范围没有到n 修改提交通过 代码: 1 class Solution(object): 2 def fib(self, n): 3 """ 4 :type n: int 5 :rtype: 阅读全文
posted @ 2023-04-26 20:13 猥琐丑八怪 阅读(21) 评论(0) 推荐(0)