what’s wrong in the code?
Pairing problem
@rockstarpkm
Where are you finding the connected components? You should use disjoint sets Union or use dfs or bfs to find the size and number of components
you can refer to this code:
what’s wrong in the code?
@rockstarpkm
Where are you finding the connected components? You should use disjoint sets Union or use dfs or bfs to find the size and number of components
you can refer to this code: