Search
⌘K

Leetcode 323. Number of Connected Components in an Undirected Graph

Given n labeled nodes and a list of undirected edges, determine how many connected components the graph contains. This requires grouping nodes reachable from each other (e.g., via DFS/BFS or Union-Find) and counting the distinct groups.

Asked at:

Amazon

Amazon


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early June, 2025

Amazon

Amazon

Senior

Comments

Your account is free and you can post anonymously if you choose.