def hammingDistance(self, x, y):
d = 0
while x or y:
d += (x + y) % 2
x, y = x//2, y//2
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.