class Solution(object):
    def fib(self, N):
        """
        :type N: int
        :rtype: int
        """
        F=[0]*31
        F[1]=1
        for i in range(2,31):
            F[i]=F[i-1]+F[i-2]
        return F[N]
        

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-18
  • 2021-06-25
  • 2022-12-23
  • 2022-02-08
  • 2021-05-24
  • 2021-09-04
  • 2021-09-23
相关资源
相似解决方案