Author's notes
I started with the brute-force set-union approach and it worked fine for the examples. The rest of the author's notes on Software Engineer interview at Airbnb, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
Create a free account to read the full note