Sponsored
Use these hints if you're stuck. Try solving on your own first.
For every pair of emails in the same account, draw an edge between those emails. The problem is about enumerating the connected components of this graph.
Solve with full IDE support and test cases