分析:
偷个懒,上次做的一样的题
代码:
1 class Solution(object): 2 def fib(self, n): 3 """ 4 :type n: int 5 :rtype: int 6 """ 7 if n<2: 8 return n 9 f=[0 for i in range(n+1)] 10 f[0]=0 11 f[1]=1 12 for i in range(2,n+1): 13 f[i]=f[i-1]+f[i-2] 14 return f[-1]%int(1e9+7)
标签:10,数列,Offer,int,斐波,那契 From: https://www.cnblogs.com/ooooopppp/p/17358241.html