Booking.com Interview Question

Coding Round: Trip Itenerary problem