Me 异或取出1的个数求取异或后1的个数返回 func hammingDistance(x int, y int) int { x = x ^ y var count = 0 for x != 0 { x = x & (x - 1) count++ } return count }