title: Add Two Numbers Without Using Arithmetic Operators
signature: function add_two_numbers_without_using_arithmetic_operators(x, y)
source_py: def add_two_numbers_without_using_arithmetic_operators(x, y):
      while (y != 0):
          carry = (x & y)
          x = (x ^ y)
          y = (carry << 1)
      return x
source_cpp: int add_two_numbers_without_using_arithmetic_operators(int x, int y) {
    while ( y != 0 ) {
      int carry = x & y;
      x = x ^ y;
      y = carry << 1;
    }
    return x;
  }
question_info.entry_fn_name: add_two_numbers_without_using_arithmetic_operators
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(x, y, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(x, y) 
      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(56, 60, 116)
      print(string.format("TEST-0...%s",result))
  
      result = driver(17, 44, 61)
      print(string.format("TEST-1...%s",result))
  
      result = driver(73, 96, 169)
      print(string.format("TEST-2...%s",result))
  
      result = driver(75, 3, 78)
      print(string.format("TEST-3...%s",result))
  
      result = driver(27, 54, 81)
      print(string.format("TEST-4...%s",result))
  
      result = driver(61, 1, 62)
      print(string.format("TEST-5...%s",result))
  
      result = driver(65, 63, 128)
      print(string.format("TEST-6...%s",result))
  
      result = driver(22, 19, 41)
      print(string.format("TEST-7...%s",result))
  
      result = driver(61, 9, 70)
      print(string.format("TEST-8...%s",result))
  
      result = driver(97, 23, 120)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": 116, "inputs": {"x": 56, "y": 60}}, {"idx": 1, "outputs": 61, "inputs": {"x": 17, "y": 44}}, {"idx": 2, "outputs": 169, "inputs": {"x": 73, "y": 96}}, {"idx": 3, "outputs": 78, "inputs": {"x": 75, "y": 3}}, {"idx": 4, "outputs": 81, "inputs": {"x": 27, "y": 54}}, {"idx": 5, "outputs": 62, "inputs": {"x": 61, "y": 1}}, {"idx": 6, "outputs": 128, "inputs": {"x": 65, "y": 63}}, {"idx": 7, "outputs": 41, "inputs": {"x": 22, "y": 19}}, {"idx": 8, "outputs": 70, "inputs": {"x": 61, "y": 9}}, {"idx": 9, "outputs": 120, "inputs": {"x": 97, "y": 23}}]