DSA Key Problems

Number of Connected Components in an Undirected Graph

Given n vertices and undirected edges, return the number of connected components.