Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Needs random test cases
Duplicate.
This looks to be a duplicate of Count the Ones and also Bit Counting and probably some others also.
Edit: Maybe make this one more interesting than the other kata by disallowing string manipulation (that's a boring solution anyway) and including more test cases where n ≥ 232 to make bitwise operation more difficult (in JS at least, bitwise operators convert the operands to 32-bit signed integers).