https://cses.fi/problemset/task/1669/ I was solving this problem and my simple approach to detect the cycle is to store the current path in a vector and when i encounter a duplicate in cycle, I print it. But Issue is 3 test cases are giving me WA out of 20. Also test cases are really huge to debug the issue with my code. Any help will be thankful
My Submission
Try this case...
4 4
1 2
1 3
3 4
1 4
Hope now you can debug your code yourself :)
It passed all testcase !!