https://geekdad.com/2014/07/solution-counting-ones/
GeekDad Puzzle of the Week Solution – Counting Ones