LeetCode 0191  Number of 1 Bits
Contents
Number of 1 Bits
Desicription
Write a function that takes an unsigned integer and returns the number of ‘1’ bits it has (also known as the Hamming weight).
Example 1:


Example 2:


Solution


Write a function that takes an unsigned integer and returns the number of ‘1’ bits it has (also known as the Hamming weight).
Example 1:


Example 2:



