readable C++ code
The key to solving this problem is that you can trace back to the previous node through the non-parent node.\n\n\tclass Solution {\n\t\tpublic:\n\t\t\tmap< int 
#### The key to solving this problem is that you can trace back to the previous node through the non-parent node.\n\n\tclass Solution {\n\t\tpublic:\n\t\t\tmap< int ,vector< int > > graph ;\n\t\t\tint time_stamp = 1 ;  \n\t\t\tstruct Vetex {\n\t\t\t\tint index ;  // time_stamp \n\t\t\t\tint lowlink ; // The earliest point that can be reached by a non-father node\n\t\t\t};\n\t\t\tvector< Vetex > check ;\n\t\t\tvector< vector<int> > ans ; \n\t\t\tvoid dfs( int v , int parent ) {\n\n\t\t\t\tcheck[v].index = time_stamp ; \n\t\t\t\tcheck[v].lowlink = time_stamp ;\n\t\t\t\ttime_stamp ++ ;\n\n\t\t\t\tfor( auto &w : graph[v] ){\n\t\t\t\t\tif ( w == parent ) continue ; \n\t\t\t\t\tif ( check[w].index == 0 ){ // not visited\n\t\t\t\t\t\tdfs( w , v ) ; \n\t\t\t\t\t\t// calc The earliest point that can be reached by a non-father node\n\t\t\t\t\t\tcheck[v].lowlink = min( check[v].lowlink , check[w].lowlink ) ; \n\t\t\t\t\t\tif ( check[w].lowlink > check[v].index ) // this must be a bridge \n\t\t\t\t\t\t\tans.push_back( {v,w } ) ; \n\t\t\t\t\t}  else {\n\t\t\t\t\t\tcheck[v].lowlink = min( check[v].lowlink , check[w].index ) ; \n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tvector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) {\n\t\t\t\tcheck.resize( n+1 ) ; \n\t\t\t\t// construct graph \n\t\t\t\tfor( auto &edge : connections ) {\n\t\t\t\t\tgraph[edge[0]].push_back( edge[1] ) ; \n\t\t\t\t\tgraph[edge[1]].push_back( edge[0] ) ; \n\t\t\t\t}\n\t\t\t\tfor( int i=0 ; i< n ; i++ ) \n\t\t\t\t\tif ( check[i].index == 0 ) // not visited \n\t\t\t\t\t\tdfs( i , -1 ) ; \n\t\t\t\treturn ans ; \n\t\t\t}\n\t\t};
[]