Graphs beautiful vertices getting tst cases wrong https://ide.codingblocks.com/s/188674

https://ide.codingblocks.com/s/188674

sure! let me see ur code

Hi , you have missed the cases when there can be many trees in the graph (connected components).
try to apply dfs for every connected component of the graph
In case of any doubt feel free to ask :slight_smile:
If you got the answer mark the doubt as resolved

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.