Skip to content

Commit 3a7c42b

Browse files
Solve : Number if 1 Bits
1 parent 8076db0 commit 3a7c42b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Solution:
2+
def hammingWeight(self, n):
3+
return bin(n).count('1')

0 commit comments

Comments
 (0)