Domanda di colloquio di Google

Algorithm problem about DFS and backtracking