Please help me with the code. I am getting tc1 and tc4 wrong-answer. I found out the no. of elements in each connected components and then multiplied each to find the answer.
Code link:
Please help me with the code. I am getting tc1 and tc4 wrong-answer. I found out the no. of elements in each connected components and then multiplied each to find the answer.
Code link:
Find connected components.
Any vertex from one set of connected components will definitely not have a path to another vertex of another connected component.
Refer this for better understanding -:
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.