Since edge u is removed , update the indegrees of all the nodes which had an incoming edge from u
for ( let x = 0 ; x < adj [ u ] . length ; x ++ ) { indeg [ adj [ u ] [ x ] ] = indeg [ adj [ u ] [ x ] ] - 1 ; if ( indeg [ adj [ u ] [ x ] ] == 0 ) { q . push ( adj [ u ] [ x ] ) ; } } } return res ; }