There will be no way to notice disjoint nodes, given the root node to start at
For disjoint graph, you need a root node for each component graph. No difference any way.
yeah but the test case has a disjoint graph in it.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.