Domanda di colloquio di Google

Problem about Tree structure (Online Coding)