Given n nodes and a list of undirected edges, return the number of connected components.
n
Input
n m
u v
Output: the component count.
5 3 0 1 1 2 3 4
2
5 4 0 1 1 2 2 3 3 4
1
Run your code against the sample tests, or Submit to run the full suite.