Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Number of 1 Bits (Easy 191)

Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the Hamming weight).

Solution:

Click here Use n & 1 to check last bit and add to counter. O(n) time, where n is number representation length.



Installation

Run make to run python and Swift files.