MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / hammingDistance

Method hammingDistance

String/HammingDistance.py:29–35  ·  view source on GitHub ↗

:type x: int :type y: int :rtype: int

(self, x, y)

Source from the content-addressed store, hash-verified

27
28class Solution(object):
29 def hammingDistance(self, x, y):
30 """
31 :type x: int
32 :type y: int
33 :rtype: int
34 """
35 return str(bin(x ^ y)).count('1')
36

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected