Number of 1 Bits(LeetCode)
Write a function that takes the binary representation of a positive integer and returns the number of set bits it has (also known as the Hamming weight).
Write a function that takes the binary representation of a positive integer and returns the number of set bits it has (also known as the Hamming weight).