Solution to Hotel Reservation Exercise