Pergunta de entrevista da empresa Tata Communications

problem on dynamic programming, tree