Skip to content

Commit d842c9f

Browse files
author
jinbeom
committed
Number of 1 Bits Solution
1 parent a2f5247 commit d842c9f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

number-of-1-bits/kayden.py

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: int) -> int:
3+
return bin(n).count("1")

0 commit comments

Comments
 (0)