title: Swap All Odd And Even Bits
signature: pub fn swap_all_odd_and_even_bits(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(
        99, 
        147
      ));
      
      println!("TEST-1...{}", driver(
        94, 
        173
      ));
      
      println!("TEST-2...{}", driver(
        11, 
        7
      ));
      
      println!("TEST-3...{}", driver(
        3, 
        3
      ));
      
      println!("TEST-4...{}", driver(
        77, 
        142
      ));
      
      println!("TEST-5...{}", driver(
        57, 
        54
      ));
      
      println!("TEST-6...{}", driver(
        54, 
        57
      ));
      
      println!("TEST-7...{}", driver(
        66, 
        129
      ));
      
      println!("TEST-8...{}", driver(
        98, 
        145
      ));
      
      println!("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 );
  }