Pregunta de entrevista de BharatPe

based on trees, graphs and dynamic programming