Bloomberg Interview Question

Toy problems on HackerRank, difficulty aimed at undergrads