@@ -0,0 +1,776 @@
+/***%0A * You are climbing a stair case. It takes n steps to reach to the top.%0A *%0A * Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?%0A */%0A%0Apublic class Solution %7B%0A    // Solution 1. Recursive O(n) right, but too slow.%0A    /*%0A    public int climbStairs(int n) %7B%0A        if (n == 0) return 0;%0A        if (n == 1) return 1;%0A        if (n == 2) return 2;%0A        return climbStairs(n - 1) + climbStairs(n - 2);        %0A    %7D%0A    */%0A    %0A    // Solution 2. Iterative O(n) O(1)%0A    public int climbStairs(int n) %7B%0A        int prev = 1;%0A        int cur = 2;%0A        int next = n;%0A        for (int i = 3; i %3C= n; i++)%7B%0A            next = prev + cur;%0A            prev = cur;%0A            cur = next;%0A        %7D%0A        return next;%0A    %7D%0A%7D%0A%0A

add ClimbingStairs.java