@@ -0,0 +1,566 @@
+package algorithms.dp;%0A%0A/**%0A * Question: http://www.geeksforgeeks.org/count-ways-reach-nth-stair/%0A * %0A * @author Sudharsanan Muralidharan%0A */%0Apublic class CountWaysToReachNStairs %7B%0A  public int countWays(int n, int m) %7B%0A    return countWays(n, m, new int%5Bn + 1%5D);%0A  %7D%0A%0A  private int countWays(int n, int m, int%5B%5D results) %7B%0A    if (n %3C 0) %7B%0A      return 0;%0A    %7D else if (n == 0) %7B%0A      return 1;%0A    %7D else if (results%5Bn%5D == 0) %7B%0A      for (int i = 1; i %3C= m; i++) %7B%0A        results%5Bn%5D += countWays((n - i), m, results);%0A      %7D%0A    %7D%0A    return results%5Bn%5D;%0A  %7D%0A%7D%0A

Add memoized solution for count ways to reach nth stair