Skip to content

Commit 4bdc65d

Browse files
authored
Create _461.cpp
1 parent 3b5b887 commit 4bdc65d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cpp/_461.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Hamming Distance
2+
3+
class Solution {
4+
public:
5+
int hammingDistance(int x, int y) {
6+
int c = x^y;
7+
return __builtin_popcount(c);
8+
}
9+
};

0 commit comments

Comments
 (0)