title: Swap All Odd And Even Bits
signature: swapAllOddAndEvenBits(x) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(x, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(x), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          99, 
          147)
      }");
  
      print("TEST-1...${driver(
          94, 
          173)
      }");
  
      print("TEST-2...${driver(
          11, 
          7)
      }");
  
      print("TEST-3...${driver(
          3, 
          3)
      }");
  
      print("TEST-4...${driver(
          77, 
          142)
      }");
  
      print("TEST-5...${driver(
          57, 
          54)
      }");
  
      print("TEST-6...${driver(
          54, 
          57)
      }");
  
      print("TEST-7...${driver(
          66, 
          129)
      }");
  
      print("TEST-8...${driver(
          98, 
          145)
      }");
  
      print("TEST-9...${driver(
          36, 
          24)
      }");
  
      return 0;
  }
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 );
  }