Tripadvisor interview question

I forget the case that has duplicates in both node.