Google | Phone Screen | Alien Dictionary but with numbers
Anonymous User
1184

Given list of N lists, return an output list where the duplicate elements are removed but the order, from the lists is preserved.

Here is the sample input and output

[1 9 5]
[1 3 9]
[2 1]
_______________
[2 1 3 9 5]

Here is what graph would look like

2 -> 1 -> 3 -> 9 -> 5
     |         ^
     |         |
     -----------
Comments (6)