Number of 1 Bits
Easy
Bit Manipulation
NeetCode 150
Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).

Constraints:

  • The input must be a binary string of length 32.