I dont like this question,
because it just check whether you know Tarjan\'s bridge-finding algorithm or you can learn it during contest. meh.....\n\n\n\nclass Solution {\npublic:\n    vec
because it just check whether you know Tarjan\'s bridge-finding algorithm or you can learn it during contest. meh.....\n\n```\n\nclass Solution {\npublic:\n    vector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) {\n        vector<bool> vi(n, false);\n        vector<int> disc(n, 0), low(n, 0), parent(n, -1);\n        vector<vector<int>> g(n, vector<int>()), res;\n        for (auto& p : connections) {\n            g[p.front()].push_back(p.back());\n            g[p.back()].push_back(p.front());\n        }\n        for (int i = 0; i < n; ++i) {\n            if (vi[i]) continue;\n            h(i, vi, disc, low, parent, g, res);\n        }\n        return res;\n    }\n\n    void h(int u, vector<bool>& vi, vector<int>& disc, vector<int>& low, vector<int>& parent, vector<vector<int>>& g, vector<vector<int>>& res) {\n        static int time = 0;\n        vi[u] = true;\n        disc[u] = low[u] = ++time;\n        for (int v : g[u]) {\n            if (!vi[v]) {\n                parent[v] = u;\n                h(v, vi, disc, low, parent, g, res);\n                low[u] = min(low[u], low[v]);\n                if (low[v] > disc[u]) {\n                    res.push_back({u, v});\n                }\n\n            } else if (v != parent[u]) {\n                low[u] = min(low[u], disc[v]);\n            }\n\n        }\n    }\n\n};\n```
[]