diff --git a/31 May Swap two nibbles in a byte b/31 May Swap two nibbles in a byte new file mode 100644 index 0000000..731dc66 --- /dev/null +++ b/31 May Swap two nibbles in a byte @@ -0,0 +1,7 @@ +class Solution { + public: + int swapNibbles(int n) { + // code here + return (((n&15)<<4)|(n>>4)); + } +};