title: Swap Two Nibbles Byte
signature: pub fn swap_two_nibbles_byte(x: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(x: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(x), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        57, 
        147
      ));
      
      println!("TEST-1...{}", driver(
        99, 
        54
      ));
      
      println!("TEST-2...{}", driver(
        66, 
        36
      ));
      
      println!("TEST-3...{}", driver(
        97, 
        22
      ));
      
      println!("TEST-4...{}", driver(
        95, 
        245
      ));
      
      println!("TEST-5...{}", driver(
        42, 
        162
      ));
      
      println!("TEST-6...{}", driver(
        95, 
        245
      ));
      
      println!("TEST-7...{}", driver(
        89, 
        149
      ));
      
      println!("TEST-8...{}", driver(
        3, 
        48
      ));
      
      println!("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 );
  }