def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
a = 1
b = 1
for i in range(n):
a, b = b, a + b
return a
转载于:https://www.cnblogs.com/theodoric008/p/9408209.html
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
a = 1
b = 1
for i in range(n):
a, b = b, a + b
return a
转载于:https://www.cnblogs.com/theodoric008/p/9408209.html