def climbStairs(n):
    """
    LeetCode 70：爬楼梯
    建模为斐波那契数列问题：f(n) = f(n-1) + f(n-2)
    """
    dp = [1, 2]
    if n < 3: return dp[n-1]
    for i in range(3, n+1):
        tmp = sum(dp)
        dp = [dp[1], tmp]
    return dp[1]