def climbStairs(self, n):
        """
        DP. The transition function should be:
        f(n) = f(n-1) + f(n-2)  n>2;
        or = 1   n=1
        or  = 2   n=2
        :param n: an integer, number of stairs
        :return: an integer, number of different combinations
        """
        if n==1: return 1
        if n==2: return 2
        f = [0 for _ in xrange(n+1)]
        f[0] = 0
        f[1] = 1
        f[2] = 2
        for i in xrange(3, n+1):
            f[i] = f[i-1]+f[i-2]
        return f[n]
dataset/ETHPy150Open algorhythms/LeetCode/069 Climbing Stairs.py/Solution.climbStairs/original