191. Number of 1 Bitsclass Solution: def hammingWeight(self, n: int) -> int: cnt = 0 while n: cnt += n & 1 # 제일 오른쪽 비트 0x01 과 and 연산해서 1이면 cnt 1증가: 1 개수 카운팅 n = n >> 1 # n 을 2나누기.해서 업데이트 (오른쪽 쉬프트와 동일) return cntclass Solution: def hammingWeight(self, n: int) -> int: res = 0 while n: # n > 0: res += n % 2 # res += n&1 ..