Last updated 5 years ago
Was this helpful?
(use List<Set<Integer>> instead of List<List<Integer>>, in order to remove key in undirected graph)
skills to get the height of node and add the node to the proper position using DFS