Pregunta de entrevista de Microsoft

Had a task on strings and trees.