Easy

Quiz

#191 Number of 1 Bits

APPROACH

Given a positive integer n, return the number of set bits (1-bits) in its binary representation (also known as the Hamming weight).

1 of 4
1:00

What is the optimal approach for this problem?