Domanda di colloquio di Atlassian

graph based question, to be solved using dfs