Algorithm · Oracle · Hard
You are given a list accounts, where each inner list accounts[i] starts with a person’s name and is followed by one or more email address strings. Two records are said to describe the same person if they share at least one email address. This relationship is transitive: if record A shares an email with B, and B shares an email with C, then A, B, and C all belong to the same person. Merge every connected set of records. For each person, output one record consisting of the…
Checking your access…