mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 14:57:08 +00:00
3 lines
97 B
Python
3 lines
97 B
Python
class Solution:
|
|
def hammingWeight(self, n: int) -> int:
|
|
return str(bin(n)).count("1") |