Implement Kosaraju's algorithm to find all strongly connected components in a directed graph.
Constraints
Example
>>> kosaraju_scc(5, [(0,1),(1,2),(2,0),(1,3),(3,4)]) [[0, 1, 2], [3], [4]] >>> kosaraju_scc(3, []) [[0], [1], [2]] >>> kosaraju_scc(1, []) [[0]] >>> kosaraju_scc(0, []) []
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints