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')
        

 

posted @ 2019-03-23 04:07  周洋  阅读(128)  评论(0编辑  收藏  举报