We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 903cf2a commit 50b939cCopy full SHA for 50b939c
solution/191. Number of 1 Bits/Solution.js
@@ -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