Skip to content

Commit 653c04a

Browse files
authored
Create Solution.py
1 parent ba888bd commit 653c04a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution(object):
2+
def hammingWeight(self, n):
3+
"""
4+
:type n: int
5+
:rtype: int
6+
"""
7+
8+
return bin(n).count("1")

0 commit comments

Comments
 (0)