Facebook | Phone | Accounts Merge
Anonymous User
2698

Location: Menlo Park
Position: Intern

This is a question that I got on a FB intern phone screen that stumped me. The input is basically a list of these emails linked to an ID, and you need to give the output with IDs that are associated with one individual as shown. Anyone have an idea of how to go about solving this? Thanks!

         Input:
# C1: bob@yahoo.com, bob@gmail.com
# C2: mary@facebook.com
# C3: bob@gmail.com, bob_1@hotmail.com
# C4: bob_1@hotmail.com
# C5: mary@facebook.com
# C6: mark@gmail.com
-----
# C1: e1, e2,
# C2: e2, e3,
# C3: e3, e4,
# ....
# CN: eN, eN+1

# Output:
#     ((C1, C3, C4), (C2, C5), (C6))
Comments (8)