title: Hypercube Graph
signature: function hypercube_graph(n)
source_py: def hypercube_graph(n):
      if (n == 1):
          return 2
      return (2 * hypercube_graph((n - 1)))
source_cpp: int hypercube_graph(int n) {
    if ( n == 1 ) return 2;
    return 2 * hypercube_graph ( n - 1 );
  }
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(n, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n) 
      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(28, 268435456)
      print(string.format("TEST-0...%s",result))
  
      result = driver(45, 35184372088832)
      print(string.format("TEST-1...%s",result))
  
      result = driver(41, 2199023255552)
      print(string.format("TEST-2...%s",result))
  
      result = driver(36, 68719476736)
      print(string.format("TEST-3...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 268435456, "inputs": {"n": 28}}, {"idx": 1, "outputs": 35184372088832, "inputs": {"n": 45}}, {"idx": 2, "outputs": 2199023255552, "inputs": {"n": 41}}, {"idx": 3, "outputs": 68719476736, "inputs": {"n": 36}}]
question_info.extension: lua
question_info.entry_fn_name: hypercube_graph
question_info.test_case_ids: 0 1 2 3
question_info.commands: lua __FILENAME__