1 testcase not passing

one test case is not passing in hackerrank. Kindly find the error in the code.
Also Set set[n] is not working whereas Set *set=new Set[n] is working. Kindly tell the reason.


@sr30 I don’t understand why you’ve made such a simple code very complex and I’m unable to read. Also you must use vector adjacency list for pushing the values and sort them to ascending other of the edges. I hope it helps.

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.