Problem
Given a non-negative integer n, return the number of 1 bits in its binary representation.
Examples
Input: 11 (1011)
Output: 3
Input: 128 (10000000)
Output: 1
Hints
Try it first. Every hint reveals a bit more.
Problem
Given a non-negative integer n, return the number of 1 bits in its binary representation.
Examples
Input: 11 (1011)
Output: 3
Input: 128 (10000000)
Output: 1
Hints
Try it first. Every hint reveals a bit more.