CSES Problem Building Road Getting TLE despite Using iterative DFS

Can anybody help me to figure out the reason why getting TLE DESPITE USING DFS Iterative Version Problem : CSES - Building Roads My Solution :https://cses.fi/problemset/result/1699864/ It will be great if you can point out

1 Like

share your code , also here is mine - “https://cses.fi/paste/31df32a9b0c7c34a92166/

I think there is some issue with your code link

https://cses.fi/paste/af0a495752ee518319f018/
Sorry for the last time

https://cses.fi/paste/af0a495752ee518319f018/