Amazon logoAmazon
CodingMembers

Count Connected Components (Union-Find)

Members only

Given items joined by transitive 'same group' relations (products in a category, or graph edges), count the distinct groups and, in some variants, each group's size or whether an edge closes a cycle.

SWE
union-find
graph
bfs
medium
Frequency
Low
Last asked
2026-05-22
Stage
phone-screen · onsite-coding

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...