[LintCode]Fibonacci(Python)

xiaoxiao2021-02-28  106

class Solution: """ @param: : an integer @return: an ineger f(n) """ def fibonacci(self, n): # write your code here ret = [0, 1] for i in range(2, n): ret.append(ret[i - 2] + ret[i - 1]) return ret[n - 1]
转载请注明原文地址: https://www.6miu.com/read-23908.html

最新回复(0)