Question d’entretien chez Pinterest

Depth-first search recursion tree problem