Question d’entretien chez Bloomberg

algorithm question about tree backtracking