ROOTTREE - Editorial

Hi, can you explain the logic. I looked at your code but didn’t completely understand what’s happening. What do you mean by connected components in a directed graph?

I have a solution of this problem, please correct me if I am wrong.

we can count the minimum number of connected sub-trees in this initially given directed tree.

let the count be n, so the answer will be n - 1.

please correct me if I am wrong

Thank you!

Can anyone explain what is wrong in this approach?
Find all the connected components and then return no. of connected components -1