Fill the level , in - time and out - time of all nodes
dfs ( 1 , - 1 , g , level , t_in , t_out ) ; let mint = Number . MAX_VALUE , maxt = Number . MIN_VALUE ; let minv = - 1 , maxv = - 1 ; for ( let i = 0 ; i < v . length ; i ++ ) {