Count Set Bits (Hamming Weight)
Easy📝 Description
Count the number of 1 bits in an unsigned integer (binary representation).
Input Format
n (unsigned integer)
Output Format
count (integer)
Constraints
0 ≤ n ≤ 2^32 - 1
🔍 Sample Input
11 (binary: 1011)
✅ Sample Output
3
Code Editor
Please login to run and submit code.
Results
Suggested Solution
Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run