title: Swap All Odd And Even Bits
signature: function swap_all_odd_and_even_bits(x)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(x, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(x), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(99, 147);
      @printf("TEST-0...%s\n",result);
      
      result = driver(94, 173);
      @printf("TEST-1...%s\n",result);
      
      result = driver(11, 7);
      @printf("TEST-2...%s\n",result);
      
      result = driver(3, 3);
      @printf("TEST-3...%s\n",result);
      
      result = driver(77, 142);
      @printf("TEST-4...%s\n",result);
      
      result = driver(57, 54);
      @printf("TEST-5...%s\n",result);
      
      result = driver(54, 57);
      @printf("TEST-6...%s\n",result);
      
      result = driver(66, 129);
      @printf("TEST-7...%s\n",result);
      
      result = driver(98, 145);
      @printf("TEST-8...%s\n",result);
      
      result = driver(36, 24);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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 );
  }