class Solution: def Fibonacci(self, n): # write code here if n == 0: return 0 if n == 1: return 1 fOne = 1 fZero = 0 for i in range(2,n+1): fN = fOne + fZero fZero = fOne fOne = fN return fN
class Solution: def Fibonacci(self, n): # write code here if n == 0: return 0 if n == 1: return 1 fOne = 1 fZero = 0 for i in range(2,n+1): fN = fOne + fZero fZero = fOne fOne = fN return fN