Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 328 Bytes

File metadata and controls

15 lines (10 loc) · 328 Bytes

Problem 191: Number of 1 Bits

Difficulty: Easy

Problem

Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).

Example

Input: 11
Output: 3
Explanation: Integer 11 has binary representation 00000000000000000000000000001011