title: Add Two Numbers Without Using Arithmetic Operators
signature: function addTwoNumbersWithoutUsingArithmeticOperators(x: number, y: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(x: number, y: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(x, y),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(56, 60, 116);
    console.log(`TEST-0...${result}`);
  
    result = driver(17, 44, 61);
    console.log(`TEST-1...${result}`);
  
    result = driver(73, 96, 169);
    console.log(`TEST-2...${result}`);
  
    result = driver(75, 3, 78);
    console.log(`TEST-3...${result}`);
  
    result = driver(27, 54, 81);
    console.log(`TEST-4...${result}`);
  
    result = driver(61, 1, 62);
    console.log(`TEST-5...${result}`);
  
    result = driver(65, 63, 128);
    console.log(`TEST-6...${result}`);
  
    result = driver(22, 19, 41);
    console.log(`TEST-7...${result}`);
  
    result = driver(61, 9, 70);
    console.log(`TEST-8...${result}`);
  
    result = driver(97, 23, 120);
    console.log(`TEST-9...${result}`);
  
  };
  
  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;
  }