Pregunta de entrevista de Harver

an algorithm problem with node