Pregunta de entrevista de Bloomberg

Leetcode style problem - data structures related