My solution 57636356 to the problem 839C - Путешествие uses BFS implementation but I am getting a wrong answer on test no.4. Editorial suggests a dfs implementation which is clear enough but I want to know what went wrong in my implementation? Any ideas or sample testcases would be a great help.
Thanks in advance!!