diff --git a/leetcode/461.py b/leetcode/461.py new file mode 100644 index 0000000..9ad4327 --- /dev/null +++ b/leetcode/461.py @@ -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 \ No newline at end of file