Problem:
Problem: Find the number of 1s in the binary representation of a number. For example:
num_ones(2) = 1 -- since "10" is the binary representation of the number "2".
num_ones(5) = 2 -- since "101" is the binary representation of the number "5"
num_ones(11) = 3 -- since "1011" is the binary representation of the number "11"
This video is part of the "Technical Interview Problems" series on various problems that arise in a technical interview setting. The solutions in this series focus on the Python language:
https://goo.gl/nM8M5B
The code used in this video may be found here:
https://github.com/vprusso/youtube_tutorials/blob/master/technical_interview/ones_binary.py
The code used in this video may be found here:
https://github.