Problem: Accounts Merge Task: Given accounts with names and emails, merge accounts that share any email. Two accounts with the same email belong to the same person.
Map each email to an ID. Union emails that appear in the same account. Then group emails by leader and associate with the account name. The tricky part: different accounts can have the same name but be different people. Use emails, not names, as the basis for merging.