Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b3d0e2a

Browse files
Create 461. Hamming Distance.cpp
1 parent 6999f27 commit b3d0e2a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
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 hammingDistance(int x, int y) {
4+
int temp = x^y;
5+
return __builtin_popcount(temp);
6+
}
7+
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /