title: Add Two Numbers Without Using Arithmetic Operators
signature: add_two_numbers_without_using_arithmetic_operators <- function(x, y) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(x, y, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(x, y), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          56L, 60L, 
          116L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          17L, 44L, 
          61L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          73L, 96L, 
          169L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          75L, 3L, 
          78L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          27L, 54L, 
          81L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          61L, 1L, 
          62L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          65L, 63L, 
          128L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          22L, 19L, 
          41L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          61L, 9L, 
          70L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          97L, 23L, 
          120L
      )))
  
  }
  
  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;
  }