Bloomberg Interview Question

Hackerrank question related to data structures and algorithms