@@ -0,0 +1,756 @@
+package com.sunny.grokkingalgorithms.fasttrack.dynamicprogrammingandrecursion;%0A%0A/**%0A * Created by sundas on 6/13/2018.%0A */%0Apublic class NumberOfWaysToReachBottomRighTFromTopLeft %7B%0A%0A  /*%0A  Count number of ways to reach bottom right from top left, if you are allowed to move%0A  only right or down.%0A   */%0A%0A  /**%0A   *%0A   * @param m%0A   * @param n%0A   * @return%0A   */%0A  public static int countNumberOfWays(int m,int n)%7B%0A    if(m == 1 && n == 1)%7B%0A      return 1;%0A    %7D%0A    if(m %3C= 0 %7C%7C n %3C= 0)%7B%0A      return 0;%0A    %7D%0A    return countNumberOfWays(m-1,n) + countNumberOfWays(m,n-1);%0A  %7D%0A  /**%0A   *%0A   * @param args%0A   */%0A  public static void main(String%5B%5D args) %7B%0A    System.out.println(countNumberOfWays(2,2));%0A    System.out.println(countNumberOfWays(3,4));%0A  %7D%0A%0A%7D%0A

Count number of ways to reach bottom right cell from top left cell. O(2.pow(n))