title: Count Ways Divide Circle Using N Non Intersecting Chords
signature: fun countWaysDivideCircleUsingNNonIntersectingChords(a: Int): Long {
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 ];
    }
question_info.test_list: [{"idx": 0, "outputs": 55534064877048198, "inputs": {"a": 32}}, {"idx": 1, "outputs": 55534064877048198, "inputs": {"a": 32}}, {"idx": 2, "outputs": 14544636039226909, "inputs": {"a": 31}}, {"idx": 3, "outputs": 1002242216651368, "inputs": {"a": 29}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Long, expected:Long):Boolean{
    return actual.equals(expected)
  }
  fun driver(a: Int, expected:Long):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(a), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(32, 55534064877048198)
      println("TEST-0...${result}")
      
      result = driver(32, 55534064877048198)
      println("TEST-1...${result}")
      
      result = driver(31, 14544636039226909)
      println("TEST-2...${result}")
      
      result = driver(29, 1002242216651368)
      println("TEST-3...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: countWaysDivideCircleUsingNNonIntersectingChords
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn