Domanda di colloquio di Multiplier

A simple tree problem which can be solve using BFS, DFS