Re: 幹 今天的leetcode

作者: zoeredbird (柔依‧紅鳥)   2023-12-14 23:07:40
509.費氏數列
class Solution(object):
def fib(self, n):
"""
:type n: int
:rtype: int
"""
if n <= 1:
return n
else:
return self.fib(n-1) + self.fib(n-2)
看到了好多新的報錯
賦值錯誤
return outside function
未定義
作者: sustainer123 (caster)   2023-12-14 23:33:00
程式課經典範例
作者: SecondRun (雨夜琴聲)   2023-12-14 23:37:00
大師

Links booklink

Contact Us: admin [ a t ] ucptt.com