Amazon Interview Question

Count all ones in a binary string