Google Phone Screen (SDE II - US)
Anonymous User
5321

I had my google phone screen today and completely choked.

You're given a list of elements. Each element has a unique id and 3 properties. Two elements are considered as duplicates if they share any
of the 3 properties. Please write a function that takes the input and returns all the duplicates.

Input:
E1: id1, p1, p2, p3
E2: id2, p1, p4, p5
E3: id3, p6, p7, p8

Output: {{id1, id2}, {id3}}

Input:
E1: id1, p1, p2, p3
E2: id2, p1, p4, p5
E3: id3, p5, p7, p8

Output: {{id1, id3, id3}}

Does anyone know how to solve this?

Comments (26)