Skip to content

Commit af4c6ee

Browse files
committed
added 191 Number of 1 bits
1 parent daed213 commit af4c6ee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

LeetCode/0191_Number_of_1_bits.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Solution:
2+
def hammingWeight(self, n: int) -> int:
3+
4+
return '{0:b}'.format(n).count('1')

0 commit comments

Comments
 (0)