Couldnt understood the hint

in hint in beginnign its told the to convert undirected graph to directed why we are doing it here and where it given in ques its undirected graph

graph is undirected as it is not given that it is directed

and it is not necessary to convert it into directed

hint:
first get all connected components and their master vertices then call dfs and check the condition for beautiful vertex (childCount[child]>childCount[parent]) and this should not be a master vertices

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.