doubt in implementation of DFS

Revision en1, by ss_96, 2017-09-19 22:22:57

I was trying to solve a simple DFS question and my code was not passing 2 test cases.

Question:link The solution is also given in the first comment of the problem. Can anyone please explain why the check variable is used in that code.

Thanks.

Tags c++, dfs, graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ss_96 2017-09-19 22:22:57 413 Initial revision (published)