```
var hammingWeight = function(n) {
var count = 0;
while(n){
if(n & 1==1){
count++;
}
n = n>>>1;
}
return count;
};
var hammingWeight = function(n) {
var count = 0;
while(n){
n &= n-1;
count++;
}
return count;
};
var hammingWeight = function(n) {
var count = 0;
while(n){
n = (n&(-n))^n;
count++;
}
return count;
};
```