c++, clear and readable solution
Found help from:\nhttps://www.youtube.com/watch?v=aZXi1unBdJA\n\nOnce I understood this, the rest was a breeze.\n\n\n```\nclass Solution {\nprivate:\n    int id
Found help from:\nhttps://www.youtube.com/watch?v=aZXi1unBdJA\n\nOnce I understood this, the rest was a breeze.\n\n\n```\nclass Solution {\nprivate:\n    int id{0};\npublic:\n    \n    void dfs(int at,int parent,vector<int> &ids, vector<int> &low_link, vector<vector<int>>&bridge, vector<vector<int>>& adjList)\n    {\n        low_link[at]=ids[at]=id++;\n        \n        for(auto &to:adjList[at])\n        {\n            if(to==parent)\n            {\n                continue;\n            }\n            if(ids[to]==-1)\n            {\n                dfs(to,at,ids,low_link,bridge,adjList);\n                low_link[at]=min( low_link[at], low_link[to]);\n                if(ids[at]<low_link[to])\n                {\n                    bridge.push_back({at,to});\n                }\n            }\n            else\n            {\n                 low_link[at]=min( low_link[at], ids[to]);\n            }\n        }\n    }\n    vector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) {\n         if(connections.empty())\n             return {};\n        \n        vector<int> ids(n,-1);\n        vector<int> low_link(n,-1);\n        vector<vector<int>>bridge;\n        vector<vector<int>> adjList(n,vector<int>());\n        \n        for(int i=0;i<connections.size();i++)\n        {\n            int at=connections[i][0];\n            int to=connections[i][1];\n            adjList[at].push_back(to);\n            adjList[to].push_back(at);\n        }\n        for(int i=0;i<n;i++)\n        {\n            if(ids[i]==-1)\n            {\n                dfs(i,-1,ids,low_link,bridge,adjList);       \n            }\n        }\n        return bridge;\n    }\n};
[]