Given an unsigned integer , return the number of 1 bits in its binary representation (also called Hamming weight).
For example, if (which is ), the answer is 3 because there are three 1s. If (which is ), the answer is 1.
This is your first bit manipulation problem. Think about how you can check each bit of and count the 1s. Before reading on, try to sketch an algorithm yourself.