'''

def findRedundantConnection(self, edges):

```
n = len(edges)
graph = {}
for i in range(1, n + 1):
graph[i] = {i}
for e in edges:
if graph[e[0]] == graph[e[1]]:
return e
graph[e[0]] |= graph[e[1]]
for node in graph[e[0]]:
graph[node] = graph[e[0]]
return None
```

'''