Question bank › Union Find
Dsa Union Find Warm-up

Email Associations

You are given a list of email associations between users. An email association connects two users. Determine the number of unique groups of users based on their email associations. Input Format: - The first line contains an integer n (1 ≤ n ≤ 100). - The second line contains an integer m (0 ≤ m ≤ 10^4) representing the number of email associations. - The following m lines each contain two integers a and b (0 ≤ a, b < n) representing an email association between user a and user b. Output Format: - Print the number of unique user groups. Example: Input: 4 2 0 1 2 3 Output: 3

Key concepts

union_findemailsassociations

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.