Pregunta de entrevista de Bloomberg

Data Structure problem, and 1 leetcode medium question