Domanda di colloquio di Bloomberg

Data Structure problem, and 1 leetcode medium question