title: Swap All Odd And Even Bits
signature: def swapAllOddAndEvenBits(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(
        99, 
        147    
      )}")   
  
  
      println(s"TEST-1...${driver(
        94, 
        173    
      )}")   
  
  
      println(s"TEST-2...${driver(
        11, 
        7    
      )}")   
  
  
      println(s"TEST-3...${driver(
        3, 
        3    
      )}")   
  
  
      println(s"TEST-4...${driver(
        77, 
        142    
      )}")   
  
  
      println(s"TEST-5...${driver(
        57, 
        54    
      )}")   
  
  
      println(s"TEST-6...${driver(
        54, 
        57    
      )}")   
  
  
      println(s"TEST-7...${driver(
        66, 
        129    
      )}")   
  
  
      println(s"TEST-8...${driver(
        98, 
        145    
      )}")   
  
  
      println(s"TEST-9...${driver(
        36, 
        24    
      )}")   
  
  }
  
source_py: def swap_all_odd_and_even_bits(x):
      even_bits = (x & 2863311530)
      odd_bits = (x & 1431655765)
      even_bits >>= 1
      odd_bits <<= 1
      return (even_bits | odd_bits)
source_cpp: unsigned int swap_all_odd_and_even_bits(unsigned int x) {
    unsigned int even_bits = x & 0xAAAAAAAA;
    unsigned int odd_bits = x & 0x55555555;
    even_bits >>= 1;
    odd_bits <<= 1;
    return ( even_bits | odd_bits );
  }