class Solution {
public:
int hammingDistance(int x, int y) {
int count = 0;
while(x&&y)
{
int r1 = x%2;
int r2 = y%2;
if(r1!=r2)count++;
x = x/2;
y = y/2;
}
while(x)
{
if(x%2!=0)count++;
x = x/2;
}
while(y)
{
if(y%2!=0)count ++;
y = y/2;
}
return count;
}
};