Back to QuestionsPractice with This Question
Reconstruct Itinerary
54.1K views•Asked at Stripe•
Hard
Question Explain
Given a list of flight tickets, reconstruct the itinerary in order. The itinerary must begin with 'JFK'. If there are multiple valid itineraries, you should return the one that has the smallest lexical order. Use DFS and sorting.
Start Trying This Question Simulation
Practice answering orally or with text to get instant AI feedback.