title: Count Ways Divide Circle Using N Non Intersecting Chords
signature: function countWaysDivideCircleUsingNNonIntersectingChords(a: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(a: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(a),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(32, 55534064877048198);
    console.log(`TEST-0...${result}`);
  
    result = driver(32, 55534064877048198);
    console.log(`TEST-1...${result}`);
  
    result = driver(31, 14544636039226909);
    console.log(`TEST-2...${result}`);
  
    result = driver(29, 1002242216651368);
    console.log(`TEST-3...${result}`);
  
  };
  
  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 ];
    }