title: Add Two Numbers Without Using Arithmetic Operators
signature: def addTwoNumbersWithoutUsingArithmeticOperators(x: Int, y: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(x: Int, y: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(x, y),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        56, 60, 
        116    
      )}")   
  
  
      println(s"TEST-1...${driver(
        17, 44, 
        61    
      )}")   
  
  
      println(s"TEST-2...${driver(
        73, 96, 
        169    
      )}")   
  
  
      println(s"TEST-3...${driver(
        75, 3, 
        78    
      )}")   
  
  
      println(s"TEST-4...${driver(
        27, 54, 
        81    
      )}")   
  
  
      println(s"TEST-5...${driver(
        61, 1, 
        62    
      )}")   
  
  
      println(s"TEST-6...${driver(
        65, 63, 
        128    
      )}")   
  
  
      println(s"TEST-7...${driver(
        22, 19, 
        41    
      )}")   
  
  
      println(s"TEST-8...${driver(
        61, 9, 
        70    
      )}")   
  
  
      println(s"TEST-9...${driver(
        97, 23, 
        120    
      )}")   
  
  }
  
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;
  }