Python3 Simplest implementation of Tarjan's Algorithm O(V+E).
Credits: Tech Revisions (http://youtu.be/RYaakWv5m6o)\n\n# O(v+e) / O(v)\nclass Solution:\n    def criticalConnections(self, n: int, connections: List[List[int]
Credits: Tech Revisions (http://youtu.be/RYaakWv5m6o)\n```\n# O(v+e) / O(v)\nclass Solution:\n    def criticalConnections(self, n: int, connections: List[List[int]]) -> List[List[int]]:\n        graph = {n:[] for n in range(n)}\n        low = [0] * n\n        res = []\n        \n        for u,v in connections:\n            graph[u].append(v)\n            graph[v].append(u)\n            \n        def dfs(node=0, parent = -1, reachable = 1):\n            low[node] = reachable\n            \n            for neighbor in graph[node]:\n                if parent != neighbor:\n                    if not low[neighbor]:\n                        dfs(neighbor, node, reachable+1)\n                    if low[neighbor] > reachable:\n                        res.append([node,neighbor])\n                    else:\n                        low[node] = min(low[neighbor], low[node])\n                    \n        dfs()\n        \n        return res\n```
[]