题目描述
Write a function that takes an unsigned integer and return the number of ‘1’ bits it has (also known as the Hamming weight).
Example 1:
1 | Input: 00000000000000000000000000001011 |
Example 2:
1 | Input: 00000000000000000000000010000000 |
Example 3:
1 | Input: 11111111111111111111111111111101 |
代码实现
1 | class Solution { |