title: Swap Two Nibbles Byte
signature: swapTwoNibblesByte(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(
          57, 
          147)
      }");
  
      print("TEST-1...${driver(
          99, 
          54)
      }");
  
      print("TEST-2...${driver(
          66, 
          36)
      }");
  
      print("TEST-3...${driver(
          97, 
          22)
      }");
  
      print("TEST-4...${driver(
          95, 
          245)
      }");
  
      print("TEST-5...${driver(
          42, 
          162)
      }");
  
      print("TEST-6...${driver(
          95, 
          245)
      }");
  
      print("TEST-7...${driver(
          89, 
          149)
      }");
  
      print("TEST-8...${driver(
          3, 
          48)
      }");
  
      print("TEST-9...${driver(
          84, 
          69)
      }");
  
      return 0;
  }
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 );
  }