I perform BFS on each unvisited node to gather all nodes in a connected component. I then count the number of nodes and edges in that component. A complete component of size k
must have exactly k*(k-1)/2 edges.
class Solution:
def countCompleteComponents(self, n: int, edges: List[List[int]]) -> int: