Question d’entretien chez Bloomberg

A recursive graph algorithm question which is hard