• + 0 comments

    can do this in 10 lines using import Data.Graph (buildG, scc) in Haskell