title: Count Ways Divide Circle Using N Non Intersecting Chords
signature: count_ways_divide_circle_using_n_non_intersecting_chords <- function(a) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(a, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(a), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          32L, 
          55534064877048198L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          32L, 
          55534064877048198L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          31L, 
          14544636039226909L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          29L, 
          1002242216651368L
      )))
  
  }
  
  main()
source_py: def count_ways_divide_circle_using_n_non_intersecting_chords(A):
      n = (2 * A)
      dpArray = ([0] * (n + 1))
      dpArray[0] = 1
      dpArray[2] = 1
      for i in range(4, (n + 1), 2):
          for j in range(0, (i - 1), 2):
              dpArray[i] += (dpArray[j] * dpArray[((i - 2) - j)])
      return int(dpArray[n])
source_cpp: int count_ways_divide_circle_using_n_non_intersecting_chords(int A) {
    int n = 2 * A;
    int dpArray [ n + 1 ] = {
      0 };
      dpArray [ 0 ] = 1;
      dpArray [ 2 ] = 1;
      for ( int i = 4;
      i <= n;
      i += 2 ) {
        for ( int j = 0;
        j < i - 1;
        j += 2 ) {
          dpArray [ i ] += ( dpArray [ j ] * dpArray [ i - 2 - j ] );
        }
      }
      return dpArray [ n ];
    }