
# 파이썬 문자열 기능 이용 1의 개수 계산 36ms
class Solution_one:
    def hammingWeight(self, n: int) -> int:
        return bin(n).count('1')


# 비트 연산 52ms
class Solution_two:
    def hammingWeight(self, n: int) -> int:
        count = 0
        while n:
            n &= n-1
            count += 1
        return count
2b9f2be50308b3c67fbcb4e629f293760e08a708
<mask token>


class Solution_two:
    <mask token>

<mask token>


class Solution_two:

    def hammingWeight(self, n: int) ->int:
        count = 0
        while n:
            n &= n - 1
            count += 1
        return count

class Solution_one:
    <mask token>


class Solution_two:

    def hammingWeight(self, n: int) ->int:
        count = 0
        while n:
            n &= n - 1
            count += 1
        return count

class Solution_one:

    def hammingWeight(self, n: int) ->int:
        return bin(n).count('1')


class Solution_two:

    def hammingWeight(self, n: int) ->int:
        count = 0
        while n:
            n &= n - 1
            count += 1
        return count


# 파이썬 문자열 기능 이용 1의 개수 계산 36ms
class Solution_one:
    def hammingWeight(self, n: int) -> int:
        return bin(n).count('1')


# 비트 연산 52ms
class Solution_two:
    def hammingWeight(self, n: int) -> int:
        count = 0
        while n:
            n &= n-1
            count += 1
        return count