← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a list of airline tickets represented by pairs of departure and arrival airports [from, to]. Your task is to reconstruct the travel itinerary in order. All tickets belong to one man who starts his journey from "JFK". You may assume all tickets form at least one valid itinerary. You must use all the tickets once and only once, and you should return the itinerary that has the smallest lexical order when multiple valid itineraries exist.