whenever i use dfs or bfs following my template I get tle for example
this question-
https://codeforces.com/contest/1600/problem/J
this is my submission-
pls help anybody i am getting tle in O(10^6)
whenever i use dfs or bfs following my template I get tle for example
this question-
https://codeforces.com/contest/1600/problem/J
this is my submission-