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 2fc3ab8 commit 8132541Copy full SHA for 8132541
number-of-1-bits/iam-edwin.py
@@ -0,0 +1,4 @@
1
+class Solution:
2
+ def hammingWeight(self, n: int) -> int:
3
+ binaryString = bin(n)[2:]
4
+ return list(binaryString).count("1")
0 commit comments