Pergunta de entrevista da empresa BharatPe

based on trees, graphs and dynamic programming