class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
l = [1,2]
if n < 3:
return n
for i in range(n-2):
l[i%2] = l[0]+l[1]
return max(l)

class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
last ,now = 1 ,1
for i in xrange(n-1):now ,last = last+now ,now
return now