HOLI problem showing tle in this code
: https://ideone.com/DkVjBr …
Solution showing tle
Hey Perul
You need to fix 2 things with your code
Firstly try to use arrays and vectors instead of maps for visited and graph creation
Since access and modification on arrays is 0(1) while in map it is 0(logn)
Secondly you are using two loops in your dfs method, the outer loop is not required. Try to modify your dfs function.