Skip to content

Commit 50b939c

Browse files
add js solution for 191
1 parent 903cf2a commit 50b939c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const hammingWeight = function(n){
2+
let result = 0;
3+
while(n){
4+
result += n & 1;
5+
n = n >>> 1;
6+
}
7+
return result;
8+
}

0 commit comments

Comments
 (0)