#191
Number of 1 Bits
easy · 76.4% accepted · 7,154 likes · top 87%
divide and conquer · bit manipulation
Description
Given a positive integer n, write a function that returns the number of set bits in its binary representation (also known as the Hamming weight).
Solution