Number of 1 Bits
class Solution:
def hammingWeight(self, n: int) -> int:
ctr = 0
while n:
ctr = ctr + (n % 2)
n = n // 2
return ctr
class Solution:
def hammingWeight(self, n: int) -> int:
ctr = 0
while n:
ctr = ctr + (n % 2)
n = n // 2
return ctr