Domanda di colloquio di Trilogy

Coding rounds, DS based algo question