Reconstruct Itinerary
Given airline tickets as (from, to) pairs, reconstruct the itinerary that starts at JFK and uses every ticket exactly once. If several itineraries exist, print the one that is smallest in lexicographic order.
Constraints
1 <= n <= 300 Airports are 3 uppercase letters
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.