Skip to content

Commit 03c8190

Browse files
authored
Update hamming-distance.cpp
1 parent 1683109 commit 03c8190

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

C++/hamming-distance.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ class Solution {
55
public:
66
int hammingDistance(int x, int y) {
77
int distance = 0;
8-
for (int z = x ^ y; z; z &= z - 1, ++distance);
8+
for (int z = x ^ y; z; z &= z - 1) {
9+
++distance;
10+
}
911
return distance;
1012
}
1113
};

0 commit comments

Comments
 (0)