title: Compute Average Two Numbers Without Overflow
signature: function compute_average_two_numbers_without_overflow(a, b)
source_py: def compute_average_two_numbers_without_overflow(a, b):
      return floor(((a + b) / 2))
source_cpp: int compute_average_two_numbers_without_overflow(int a, int b) {
    return ( a + b ) / 2;
  }
question_info.entry_fn_name: compute_average_two_numbers_without_overflow
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
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, b, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(a, b) 
      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(1, 44, 22)
      print(string.format("TEST-0...%s",result))
  
      result = driver(6, 61, 33)
      print(string.format("TEST-1...%s",result))
  
      result = driver(75, 20, 47)
      print(string.format("TEST-2...%s",result))
  
      result = driver(51, 17, 34)
      print(string.format("TEST-3...%s",result))
  
      result = driver(19, 25, 22)
      print(string.format("TEST-4...%s",result))
  
      result = driver(82, 98, 90)
      print(string.format("TEST-5...%s",result))
  
      result = driver(72, 21, 46)
      print(string.format("TEST-6...%s",result))
  
      result = driver(48, 41, 44)
      print(string.format("TEST-7...%s",result))
  
      result = driver(12, 17, 14)
      print(string.format("TEST-8...%s",result))
  
      result = driver(41, 80, 60)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": 22, "inputs": {"a": 1, "b": 44}}, {"idx": 1, "outputs": 33, "inputs": {"a": 6, "b": 61}}, {"idx": 2, "outputs": 47, "inputs": {"a": 75, "b": 20}}, {"idx": 3, "outputs": 34, "inputs": {"a": 51, "b": 17}}, {"idx": 4, "outputs": 22, "inputs": {"a": 19, "b": 25}}, {"idx": 5, "outputs": 90, "inputs": {"a": 82, "b": 98}}, {"idx": 6, "outputs": 46, "inputs": {"a": 72, "b": 21}}, {"idx": 7, "outputs": 44, "inputs": {"a": 48, "b": 41}}, {"idx": 8, "outputs": 14, "inputs": {"a": 12, "b": 17}}, {"idx": 9, "outputs": 60, "inputs": {"a": 41, "b": 80}}]