Any test case or hints?

Idea at a glance:
I ran bfs from the unvisited nodes and and counted number of connected nodes each time… after each bfs I updated maximum groups required with the counter.