Back to Questions

Reconstruct Itinerary

54.1K viewsAsked 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.

Practice with This Question