mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 03:27:07 +00:00
Time: 34 ms (66.38%), Space: 13.8 MB (43.78%) - LeetHub
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
class Solution:
|
||||
def hammingWeight(self, n: int) -> int:
|
||||
return str(bin(n)).count("1")
|
||||
Reference in New Issue
Block a user