#332

Reconstruct Itinerary

hard· Advanced Graphsruns: 0

You are given a list of airline tickets where tickets[i] = [from, to] represents a one-way flight. Reconstruct the itinerary in order. All tickets belong to a traveler who departs from 'JFK', so the itinerary must begin with 'JFK'. If there are multiple valid itineraries, return the itinerary with the smallest lexical order when read as a single string.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.