title: Count Possible Paths Top Left Bottom Right Nxm Matrix 2
signature: class Solution {
  
      public Long countPossiblePathsTopLeftBottomRightNxmMatrix2(Integer p, Integer q) {
source_py: def count_possible_paths_top_left_bottom_right_nxm_matrix_2(p, q):
      dp = [1 for i in range(q)]
      for i in range((p - 1)):
          for j in range(1, q):
              dp[j] += dp[(j - 1)]
      return dp[(q - 1)]
source_cpp: int count_possible_paths_top_left_bottom_right_nxm_matrix_2(int m, int n) {
    int dp [ n ] = {
      1 };
      dp [ 0 ] = 1;
      for ( int i = 0;
      i < m;
      i ++ ) {
        for ( int j = 1;
        j < n;
        j ++ ) {
          dp [ j ] += dp [ j - 1 ];
        }
      }
      return dp [ n - 1 ];
    }
question_info.extension: java
question_info.entry_fn_name: countPossiblePathsTopLeftBottomRightNxmMatrix2
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 1088430, "inputs": {"p": 70, "q": 5}}, {"idx": 1, "outputs": 5743572120, "inputs": {"p": 9, "q": 59}}, {"idx": 2, "outputs": 1, "inputs": {"p": 54, "q": 1}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer p, Integer q, Long expected){
          try{
              Driver driver = new Driver();
              if (driver.run(p, q,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(70, 5, 1088430L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(9, 59, 5743572120L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(54, 1, 1L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer p, Integer q, Long expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(p, q),expected);
      }
      
      public boolean validateSolution(Long actual, Long expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2
question_info.commands: java __FILENAME__