Memory Limit Exceeded (passing by reference)


#1

Using vector of vector to store the graph and passing it by reference in the dfs function to detect cycle, still getting memory limit exceeded. Any solution ?