You are given n nodes labeled 0 to n - 1 and a list of undirected edges where each entry [a, b] connects node a and node b.
Return the number of connected components in the graph.
5, [[0,1],[1,2],[3,4]]5, [[0,1],[1,2],[2,3],[3,4]]4, []1, []6, [[0,1],[2,3],[4,5]]3, [[0,1],[0,2],[1,2]]7, [[0,1],[1,2],[2,0],[3,4]]