title: Count Ways Divide Circle Using N Non Intersecting Chords
signature: function count_ways_divide_circle_using_n_non_intersecting_chords(a)
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_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(a, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(a) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(32, 55534064877048198)
      print(string.format("TEST-0...%s",result))
  
      result = driver(32, 55534064877048198)
      print(string.format("TEST-1...%s",result))
  
      result = driver(31, 14544636039226909)
      print(string.format("TEST-2...%s",result))
  
      result = driver(29, 1002242216651368)
      print(string.format("TEST-3...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
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: lua
question_info.entry_fn_name: count_ways_divide_circle_using_n_non_intersecting_chords
question_info.test_case_ids: 0 1 2 3
question_info.commands: lua __FILENAME__