HOLI- Graph Problem

It’s giving error. Please Check

@Mansi2103 number of edges are n-1, so run loop from i=0 till n-2 . Also before inserting edge do x-- and y-- as you have taken the vertices from 0 to n-1.

@Mansi2103 Also please mark this doubt as resolved if i am able to solve your doubt.

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.