题目:
题解:
python
class Solution:
def hammingDistance(self, x, y):
ret = 0
bx, by = bin(x)[2:].zfill(32), bin(y)[2:].zfill(32)
for i in range(32):
if bx[i] != by[i]:
ret += 1
return ret