Write a function that takes an unsigned integer and returns the number of '1' bits (Hamming weight).
Input: n=00000000000000000000000000001011 Output: 3 Input: n=11111111111111111111111111111101 Output: 31
Unlock hints progressively — start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features