Java DFS Solution similar to Tarjan, maybe easier to understand
We record the timestamp that we visit each node. For each node, we check every neighbor except its parent and return a smallest timestamp in all its neighbors. 
We record the timestamp that we visit each node. For each node, we check every neighbor except its parent and return a smallest timestamp in all its neighbors. If this timestamp is strictly less than the node\'s timestamp, we know that this node is somehow in a cycle. Otherwise, this edge from the parent to this node is a critical connection.\n\n```\nclass Solution {\n    int T = 1;\n    public List<List<Integer>> criticalConnections(int n, List<List<Integer>> connections) {\n        // use a timestamp, for each node, check the samllest timestamp that can reach from the node\n        // construct the graph first\n        List[] graph = new ArrayList[n];\n        for (int i = 0; i < n; i++) {\n            graph[i] = new ArrayList<Integer>();\n        }\n        for (List<Integer> conn : connections) {\n            graph[conn.get(0)].add(conn.get(1));\n            graph[conn.get(1)].add(conn.get(0));\n        }\n        \n        int[] timestamp = new int[n]; // an array to save the timestamp that we meet a certain node\n        \n        // for each node, we need to run dfs for it, and return the smallest timestamp in all its children except its parent\n        List<List<Integer>> criticalConns = new ArrayList<>();\n        dfs(n, graph, timestamp, 0, -1, criticalConns);\n        return criticalConns;\n    }\n    \n    // return the minimum timestamp it ever visited in all the neighbors\n    private int dfs(int n, List[] graph, int[] timestamp, int i, int parent, List<List<Integer>> criticalConns) {\n        if (timestamp[i] != 0) return timestamp[i];\n        timestamp[i] = T++;\n\n        int minTimestamp = Integer.MAX_VALUE;\n        for (int neighbor : (List<Integer>) graph[i]) {\n            if (neighbor == parent) continue; // no need to check the parent\n            int neighborTimestamp = dfs(n, graph, timestamp, neighbor, i, criticalConns);\n            minTimestamp = Math.min(minTimestamp, neighborTimestamp);\n        }\n        \n        if (minTimestamp >= timestamp[i]) {\n            if (parent >= 0) criticalConns.add(Arrays.asList(parent, i));\n        }\n        return Math.min(timestamp[i], minTimestamp);\n    }\n}\n```
[]