We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1beb0aa commit 43c8be2Copy full SHA for 43c8be2
number-of-1-bits/sooooo-an.ts
@@ -0,0 +1,3 @@
1
+function hammingWeight(n: number): number {
2
+ return n.toString(2).replace(/0/g, "").length;
3
+}
0 commit comments