Leetcode 461. Hamming Distance

class Solution(object):
    def hammingDistance(self, x, y):
        """
        :type x: int
        :type y: int
        :rtype: int
        """
        return str(bin(x^y)).count('1')
        
原文地址:https://www.cnblogs.com/zywscq/p/10582347.html