Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions 31 May Swap two nibbles in a byte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Solution {
public:
int swapNibbles(int n) {
// code here
return (((n&15)<<4)|(n>>4));
}
};