Pergunta de entrevista da empresa Google

Problem about Tree structure (Online Coding)