Leetcode in Java && Oracle
420 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-11-19_14-54-18.png
29 KB
#N461. Hamming Distance
problem link

#solution
class Solution {
public int hammingDistance(int x, int y) {
int num=x^y;
int count=0;
while(num>0){
if(num%2==1)
count++;

num/=2;
}

return count;
}
}