Given a positive integer n, write a function that returns the number of set bits (1-bits) in its binary representation. This is also known as the Hamming weight.
n = 113n = 1281n = 2147483645301 <= n <= 2^31 - 1Expected time complexity: O(log n)Run your code to see results
Use Cmd+Enter to run