class Solution: def hammingDistance(self, x: int, y: int) -> int: x_y = x ^ y distance = bin(x_y)[2:].count("1") return distance