NeetCode #629LC-332HardAdvanced GraphsNC 150NC 250
← Back to All Problems

#629 · #332 · Reconstruct Itinerary(重新安排行程)

📌 Problem Statement & Constraints

You are given a list of airline tickets where tickets[i] = [from, to]. Reconstruct the itinerary in order, starting from "JFK", using all tickets exactly once. If several valid itineraries exist, return the lexicographically smallest. Constraints: 1 <= tickets.length <= 300; the input is guaranteed to have at least one valid itinerary.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!