Problem Link: Problem - B - Codeforces
Submission Link: Submission #83349621 - Codeforces
I am trying to detect a cycle by using dfs and trying not to print Yes if we have come back to the last visited node in our dfs search… I can’t understand where I am going wrong. It’s failing some tests. Please help.