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 c2f15ec commit b908387Copy full SHA for b908387
461/461.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def hammingDistance(self, x: int, y: int) -> int:
3
+ res = 0
4
+ while(x or y):
5
+ res += x % 2 != y % 2
6
+ x = x >> 1
7
+ y = y >> 1
8
+
9
+ return res
0 commit comments