Just need to compute n+1'th fibonacci number.
def climbStairs(self, n):
l1, l2 = 0, 1
for _ in range(n):
l1, l2 = l2, l1 + l2
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.