value. Count how many ones its binary representation contains.
If the function is called a huge number of times, how would you speed it up?value=13 → 3
13 is 1101, which has three ones.
value=64 → 1
64 is 1000000, which has a single one.
value=0 → 0
value=13
3
Run checks the first 3 tests in your browser. Submit checks all 131 tests on the server, hidden ones included.