C++ Solution. || Using DFS
\nclass Solution {\npublic:\n    bool dfs(vector<vector<int>> &adj,vector<int> &visited,int v,int parent){\n        visited[v]=1;\n        for(int i=0;i<adj[v].
```\nclass Solution {\npublic:\n    bool dfs(vector<vector<int>> &adj,vector<int> &visited,int v,int parent){\n        visited[v]=1;\n        for(int i=0;i<adj[v].size();i++){\n            if(!visited[adj[v][i]]){\n                if(dfs(adj,visited,adj[v][i],v)){\n                    return true;\n                }\n            }else if(parent!=adj[v][i]){\n                return true;\n            }\n        }\n        return false;\n    }\n    vector<int> findRedundantConnection(vector<vector<int>>& edges) {\n        vector<int> res;\n        int n=edges.size();\n        int minV=INT_MAX;\n        vector<vector<int>> adj(n+1);\n        for(int i=0;i<n;i++){\n            adj[edges[i][0]].push_back(edges[i][1]);\n            adj[edges[i][1]].push_back(edges[i][0]);\n            vector<int> visited(n+1,0);\n            if(dfs(adj,visited,edges[i][0],-1)){\n                res={edges[i][0],edges[i][1]};\n                break;\n            }\n        }\n        return res;\n    }\n};\n```
['Depth-First Search', 'C', 'C++']