Skip to content

Commit 95eba6c

Browse files
authored
Create 31 May Swap two nibbles in a byte
1 parent db44b4c commit 95eba6c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

31 May Swap two nibbles in a byte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Solution {
2+
public:
3+
int swapNibbles(int n) {
4+
// code here
5+
return (((n&15)<<4)|(n>>4));
6+
}
7+
};

0 commit comments

Comments
 (0)