#不要用递归 递归速度太慢
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
#
# @param n int整型
# @return int整型
#
def f(l, n):
for i in range(n - 2):
l.append(l[-1] + l[-2])
return l[-1]
class Solution:
def Fibonacci(self , n: int) -> int:
# write code here
print(f([1,1],n))
return f([1,1],n)

京公网安备 11010502036488号