Count the number of 1 bits in an integer using Brian Kernighan's algorithm.
Constraints
Example
>>> brian_kernighan_count(0) 0 >>> brian_kernighan_count(7) 3 >>> brian_kernighan_count(255) 8 >>> brian_kernighan_count(1024) 1
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints