Unable to understand the order


  • 0
    S

    Input:
    [["EZE","TIA"],["EZE","HBA"],["AXA","TIA"],["JFK","AXA"],["ANU","JFK"],["ADL","ANU"],["TIA","AUA"],["ANU","AUA"],["ADL","EZE"],["ADL","EZE"],["EZE","ADL"],["AXA","EZE"],["AUA","AXA"],["JFK","AXA"],["AXA","AUA"],["AUA","ADL"],["ANU","EZE"],["TIA","ADL"],["EZE","ANU"],["AUA","ANU"]]
    Output:
    ["JFK","AXA","AUA","ADL","ANU","AUA","ANU","EZE","ADL","EZE","ANU","JFK","AXA","EZE","HBA"]
    Expected:
    ["JFK","AXA","AUA","ADL","ANU","AUA","ANU","EZE","ADL","EZE","ANU","JFK","AXA","EZE","TIA","AUA","AXA","TIA","ADL","EZE","HBA"]

    In the expected output, why would ("EZE","TIA") come before ("EZE","HBA"). Since, we have to give results in lexical order wouldn't ("EZE","HBA") pop out before ("EZE","TIA")


  • 0

    Your answer doesn't use all tickets.


Log in to reply
 

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