title: Swap All Odd And Even Bits
signature: swapAllOddAndEvenBits :: Integer -> Integer
  swapAllOddAndEvenBits x = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> String
  driver x expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME x) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (99) (147) )
  
      printf "TEST-1...%s\n" (driver (94) (173) )
  
      printf "TEST-2...%s\n" (driver (11) (7) )
  
      printf "TEST-3...%s\n" (driver (3) (3) )
  
      printf "TEST-4...%s\n" (driver (77) (142) )
  
      printf "TEST-5...%s\n" (driver (57) (54) )
  
      printf "TEST-6...%s\n" (driver (54) (57) )
  
      printf "TEST-7...%s\n" (driver (66) (129) )
  
      printf "TEST-8...%s\n" (driver (98) (145) )
  
      printf "TEST-9...%s\n" (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 );
  }