STEP 2 pf Kosaraju 's Algorithm which  traverses the inverse graph. After this,  array scc[] stores the corresponding value
while ( ! s . empty ( ) ) { int n = s . top ( ) ; s . pop ( ) ; if ( ! visitedInv [ n ] ) { dfsSecond ( n ) ; counter ++ ; } } for ( int i = 1 ; i <= n ; i ++ ) {