title: Add Two Numbers Without Using Arithmetic Operators
signature: function addTwoNumbersWithoutUsingArithmeticOperators($x, $y) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($x, $y, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($x, $y), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        56, 60, 
        116));
      
      printf("TEST-1...%s\n",driver(
        17, 44, 
        61));
      
      printf("TEST-2...%s\n",driver(
        73, 96, 
        169));
      
      printf("TEST-3...%s\n",driver(
        75, 3, 
        78));
      
      printf("TEST-4...%s\n",driver(
        27, 54, 
        81));
      
      printf("TEST-5...%s\n",driver(
        61, 1, 
        62));
      
      printf("TEST-6...%s\n",driver(
        65, 63, 
        128));
      
      printf("TEST-7...%s\n",driver(
        22, 19, 
        41));
      
      printf("TEST-8...%s\n",driver(
        61, 9, 
        70));
      
      printf("TEST-9...%s\n",driver(
        97, 23, 
        120));
      
  }
  
  main();
  ?>
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;
  }