Clean code with reference to understand Tarjan's Algorithm (96%, 100%)
Turns out the test cases have connected graphs, because I didn\'t need to do a for loop starting dfs at all nodes, but for a more complete solution\nyou should 
Turns out the test cases have connected graphs, because I didn\'t need to do a for loop starting dfs at all nodes, but for a more complete solution\nyou should run it starting from all nodes, not just 0. \nThe question is based on tarjan\'s algorithm. You just have to understand the concept of low links and once you do, you have to generalize the approach using depth of dfs.\nAlso, just make the vectors as private class variable instead of putting it in the function, the code would be cleaner!\n \nI used this [Bridges and Articulation Points](https://www.youtube.com/watch?v=aZXi1unBdJA) to understand the concept, it\'s not perfect, but rather well explained, he runs through the program with visualization which certainly helps. He also has a video on SCC (strongly connected components, check it for better understanding)\n\n```\nvoid dfs(int cur, int parent, int& dep, vector<vector<int>>& adjList, vector<vector<int>>& bridges, vector<int>& depth, vector<int>& lowLink, vector<bool>& visited) {\n    visited[cur] = true;\n    depth[cur] = lowLink[cur] = ++dep;\n    \n    for(auto to: adjList[cur]) {\n        if(to == parent) continue;\n        if(!visited[to]) {\n            dfs(to, cur, dep, adjList, bridges, depth, lowLink, visited); \n            lowLink[cur] = min(lowLink[cur], lowLink[to]);\n            if(depth[cur] < lowLink[to]) bridges.push_back({cur, to}); \n        } else lowLink[cur] = min(lowLink[cur], depth[to]);\n    }\n}\n\nvector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) {\n    vector<vector<int>> adjList(n), bridges;\n    for(auto i: connections) {\n        adjList[i[0]].push_back(i[1]);\n        adjList[i[1]].push_back(i[0]);  \n    }\n    vector<int> depth(n), lowLink(n);\n    vector<bool> visited(n);\n    int dep = 0;\n    dfs(0, -1, dep, adjList, bridges, depth, lowLink, visited); // for(int i = 0; i < n; i++) if(!visited[i]) dfs(i, ...)\n    return bridges;\n}\n```
['C']