class Solution:
def hammingDistance(self, x: int, y: int) -> int:
temp = x ^ y
count = 0
while (temp):
count += (temp%2)
temp = temp //2
return count
leetcode 461. 汉明距离
最新推荐文章于 2024-04-26 11:04:56 发布