Count the number of 1s in the binary representation of a non-negative integer.
Constraints
Example
>>> count_set_bits(0) 0 >>> count_set_bits(5) 2 >>> count_set_bits(13) 3 >>> count_set_bits(255) 8
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints