Booking.com interview question

array intersection and combination