Question d’entretien chez Bloomberg

Hackerrank question related to data structures and algorithms