update format
This commit is contained in:
parent
813dca2910
commit
29d718861a
@ -1,5 +1,5 @@
|
|||||||
class Solution:
|
class Solution:
|
||||||
def hammingDistance(self, x: int, y: int) -> int:
|
def hammingDistance(self, x: int, y: int) -> int:
|
||||||
x_y = x^y
|
x_y = x ^ y
|
||||||
distance = bin(x_y)[2:].count("1")
|
distance = bin(x_y)[2:].count("1")
|
||||||
return distance
|
return distance
|
||||||
|
Loading…
x
Reference in New Issue
Block a user