Count connected friend groups

0
Remix

Given people and the friendships between them, count the friend groups: two people are in the same group when they are friends, directly or through a chain of friends. Solve it with a graph traversal or union-find and give the time and space.

OpenAITechnical phone screenLast asked Jul 2026
No answer yet. Write the first one; the best answer gets endorsed.