C++ Tarjan algorithm
```\nclass Solution {\npublic:\n    vector> criticalConnections(int n, vector>& connections) {\n        vector> res;\n        vector> graph(n);              \n 
```\nclass Solution {\npublic:\n    vector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) {\n        vector<vector<int>> res;\n        vector<vector<int>> graph(n);              \n        vector<bool> visited(n, false);\n        vector<int> timesLow(n);\n        vector<int> timesVisited(n);\n        \n        buildGraph(connections, graph);\n        dfs(visited, timesLow, timesVisited, graph, 0, -1, 0, res);\n        return res;\n    }\n    \nprivate:\n    void dfs(vector<bool>& visited, \n             vector<int>& timesLow, \n             vector<int>& timesVisited, \n             vector<vector<int>>& graph, \n             int current, \n             int parent, \n             int time,\n             vector<vector<int>>& res) {\n        \n        visited[current] = true;\n        timesVisited[current] = time;\n        timesLow[current] = time;\n        ++time;\n        \n        for (int neighbour : graph[current]) {\n            if (neighbour == parent) {\n                continue;\n            }\n            \n            if (!visited[neighbour]) {\n                dfs(visited, timesLow, timesVisited, graph, neighbour, current, time, res);\n                timesLow[current] = min(timesLow[current], timesLow[neighbour]);\n                if (timesVisited[current] < timesLow[neighbour]) {\n                    res.push_back({current, neighbour});\n                }                  \n            } else {\n                timesLow[current] = min(timesLow[current], timesVisited[neighbour]);\n            }\n        }    \n    }\n    \n    void buildGraph(const vector<vector<int>>& connections, vector<vector<int>>& graph) {\n        for (const vector<int>& connection : connections) {\n            graph[connection[0]].push_back(connection[1]);\n            graph[connection[1]].push_back(connection[0]);\n        }\n    }\n};
[]