Pergunta de entrevista da empresa Google

Algorithm problem about DFS and backtracking