We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb63f34 commit 7bb644aCopy full SHA for 7bb644a
src/easy/hamming-distance.go
@@ -0,0 +1,8 @@
1
+package easy
2
+
3
+import "math/bits"
4
5
+// https://leetcode.com/problems/hamming-distance/
6
+func hammingDistance(x int, y int) int {
7
+ return bits.OnesCount(uint(x ^ y))
8
+}
0 commit comments