finish 461
This commit is contained in:
5
leetcode/461.py
Normal file
5
leetcode/461.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class Solution:
|
||||||
|
def hammingDistance(self, x: int, y: int) -> int:
|
||||||
|
x_y = x^y
|
||||||
|
distance = bin(x_y)[2:].count("1")
|
||||||
|
return distance
|
||||||
Reference in New Issue
Block a user