509. Fibonacci Number [Easy] 斐波纳
2019-06-01 本文已影响0人
一个想当大佬的菜鸡
509. Fibonacci Number
class Solution(object):
def fib(self, N):
"""
:type N: int
:rtype: int
"""
a, b = 0, 1
while N > 0:
N -= 1
b = a + b
a = b - a
return a