give weight undirected connect graph n vertex number 0 n 1 array edge edgesi ai bi weighti represent bidirectional weighted edge node ai bi a minimum span tree MST subset graph edge connect vertex cycle minimum possible total edge weightfind critical pseudocritical edge give graph minimum span tree MST an mst edge deletion graph cause MST weight increase call critical edge on hand pseudocritical edge appear mst allnote return index edge order Example 1input n 5 edge 011121232032043343146output 012345explanation the figure describe graphthe following figure show possible MSTsNotice edge 0 1 appear mst critical edge return list outputthe edge 2 3 4 5 mst consider pseudocritical edge we add second list outputexample 2input n 4 edge 011121231031output 0123explanation we observe 4 edge equal weight choose 3 edge give 4 yield MST therefore 4 edge pseudocritical Constraints2 n 1001 edgeslength min200 n n 1 2edgesilength 30 ai bi n1 weighti 1000all pair ai bi distinct