Module Expr Str Assign NameStore Str ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Num If CompareEq NameLoad Num body Return NameLoad If CompareEq NameLoad Num body Return NameLoad Assign NameStore Num For NameStore Call NameLoad Num NameLoad body Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq NameLoad Num body Return Num If CompareEq NameLoad Num body Return Num Assign NameStore ListComp Num comprehension NameStore Call NameLoad BinOpAdd NameLoad Num Assign SubscriptStore NameLoad Index Num Num Assign SubscriptStore NameLoad Index Num Num Assign SubscriptStore NameLoad Index Num Num For NameStore Call NameLoad Num BinOpAdd NameLoad Num body Assign SubscriptStore NameLoad Index NameLoad BinOpAdd SubscriptLoad NameLoad Index BinOpSub NameLoad Num SubscriptLoad NameLoad Index BinOpSub NameLoad Num Return SubscriptLoad NameLoad Index NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Print Call AttributeLoad Call NameLoad attr Num
N/A N/A 
You are climbing a stair case. It takes n steps to reach to the top.

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
 N/A __author__ Danyang Solution N/A N/A climbStairs_save_memory N/A N/A self n N/A N/A N/A 
        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
         N/A f_n_minus_2 1 N/A f_n_minus_1 2 N/A N/A n 1 N/A N/A f_n_minus_2 N/A N/A n 2 N/A N/A f_n_minus_1 N/A fn 0 N/A i N/A range 2 n N/A N/A fn N/A f_n_minus_1 f_n_minus_2 N/A f_n_minus_2 f_n_minus_1 N/A f_n_minus_1 fn N/A fn N/A climbStairs N/A N/A self n N/A N/A N/A 
        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
         N/A N/A n 1 N/A N/A 1 N/A N/A n 2 N/A N/A 2 N/A f N/A 0 N/A _ N/A xrange N/A n 1 N/A N/A f N/A 0 0 N/A N/A f N/A 1 1 N/A N/A f N/A 2 2 N/A i N/A xrange 3 N/A n 1 N/A N/A N/A f N/A i N/A N/A f N/A N/A i 1 N/A f N/A N/A i 2 N/A N/A f N/A n N/A N/A N/A N/A __name__ __main__ N/A N/A N/A N/A N/A Solution climbStairs 3