Input: [["JFK","ATL"],["ATL","JFK"]] why Expected: ["JFK","ATL","JFK"] not ["ATL","JFK","ATL"]


  • 0
    S

    Input: [["JFK","ATL"],["ATL","JFK"]]
    Output: ["ATL","JFK","ATL"]
    Expected: ["JFK","ATL","JFK"]

    Does it mean that ["ATL","JFK","ATL"] is larger than ["JFK","ATL","JFK"] in lexical order?


  • 0

    From the description:

    All of the tickets belong to a man who departs from JFK. Thus, the itinerary must begin with JFK.


  • 0
    G

    OMG, I'm an idiot. Didn't see that line either.
    I would be interesting if we have to find a starting point though.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.