Given `n` nodes labeled `0..n-1` and an undirected `edges` list of `[a, b]` pairs, implement `countComponents(n, edges)` returning the number of connected components.
Run your code to see results.