Pregunta de entrevista de Amazon

Trees and graphs+ Dynamic Programming