Booking.com Interview Question

array intersection and combination