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.
doubt in implementation of DFS
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.