Question d’entretien chez Tata Communications

problem on dynamic programming, tree