
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:
1 |
Input: 11 |
Example 2:
1 |
Input: 128 |
Solution
1 |
class { |

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:
1 |
Input: 11 |
Example 2:
1 |
Input: 128 |
1 |
class { |
近期评论