title: Swap Two Nibbles Byte
signature: def swapTwoNibblesByte(x: 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, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(x),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        57, 
        147    
      )}")   
  
  
      println(s"TEST-1...${driver(
        99, 
        54    
      )}")   
  
  
      println(s"TEST-2...${driver(
        66, 
        36    
      )}")   
  
  
      println(s"TEST-3...${driver(
        97, 
        22    
      )}")   
  
  
      println(s"TEST-4...${driver(
        95, 
        245    
      )}")   
  
  
      println(s"TEST-5...${driver(
        42, 
        162    
      )}")   
  
  
      println(s"TEST-6...${driver(
        95, 
        245    
      )}")   
  
  
      println(s"TEST-7...${driver(
        89, 
        149    
      )}")   
  
  
      println(s"TEST-8...${driver(
        3, 
        48    
      )}")   
  
  
      println(s"TEST-9...${driver(
        84, 
        69    
      )}")   
  
  }
  
source_py: def swap_two_nibbles_byte(x):
      return (((x & 15) << 4) | ((x & 240) >> 4))
source_cpp: int swap_two_nibbles_byte(int x) {
    return ( ( x & 0x0F ) << 4 | ( x & 0xF0 ) >> 4 );
  }