This commit is contained in:
Gyubin Han
2025-02-19 14:09:55 +09:00
parent e3c6c8b32a
commit dede0dca01
36 changed files with 555 additions and 0 deletions

9
leetcode/191.py Normal file
View File

@@ -0,0 +1,9 @@
class Solution:
def hammingWeight(self, n: int) -> int:
count=0
b=bin(n)
for i in range(2,len(b)):
if b[i]=="1":
count+=1
return count