class Solution(object):
    def hammingDistance(self, x, y):
        """
        :type x: int
        :type y: int
        :rtype: int
        """
        return str(bin(x^y)).count('1')
        

 

相关文章:

  • 2022-01-26
  • 2021-07-07
猜你喜欢
  • 2021-05-14
  • 2021-08-09
  • 2022-02-27
  • 2021-08-10
  • 2022-12-23
  • 2021-10-29
  • 2021-05-25
相关资源
相似解决方案