[LeetCode] 509. Fibonacci Number
Python
class Solution:
def fib(self, n: int) -> int:
a, b = 0, 1
for i in range(n):
a, b = a + b, a
return a
class Solution:
def fib(self, n: int) -> int:
a, b = 0, 1
for i in range(n):
a, b = a + b, a
return a
댓글남기기