Hello Sir,
I am getting in runtime error. I am solving this que through Disjoint set union .Please help me in optimising my solution.
Thanking you in advance.
Hello Sir,
I am getting in runtime error. I am solving this que through Disjoint set union .Please help me in optimising my solution.
Thanking you in advance.
@trojan_code forgetting about runtime error, I see incorrect approach of yours!
there are 2 simple cases:
Yes , Thank you . I got it