Tripadvisor Interview Question

I forget the case that has duplicates in both node.