Walmart Global Tech interview question

Number of 1’s in binary string