Given a directed graph with n nodes and edges, find its strongly connected components using Kosaraju's algorithm. Return the components as a nested array, each component sorted ascending and the list of components sorted. The input is JSON {n, edges}.
Input: JSON {n, edges}.
Output: Nested array — the SCCs, sorted.
Input: {"n":5,"edges":[[0,1],[1,2],[2,0],[1,3],[3,4]]}
Output: [[0,1,2],[3],[4]]
Explanation: One cyclic component plus two singletons.Input: {"n":1,"edges":[]}
Output: [[0]]
Explanation: Single node.Input: {"n":3,"edges":[[0,1],[1,2],[2,0]]}
Output: [[0,1,2]]
Explanation: One SCC.1<=n<=10^5directed