```
class Solution(object):
def hammingDistance(self, x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
res = bin(x^y)
t = 0
for i in range(len(res)):
if res[i]=='1':
t += 1
return t
```