Wrong test case


  • 0

    Input:
    [["JFK","KUL"],["JFK","NRT"],["NRT","JFK"]]
    Output:
    ["JFK","KUL","NRT","JFK"]
    Expected:
    ["JFK","NRT","JFK","KUL"]

    I even doubted if Collections.sort sorted them in wrong order. But apparently not.

    [EDIT] Bad coding. did not remove from result list when hitting leaf.

    Thanks for pointing out the obvious..


  • 0
    T

    There is no flight from KUL to NRT


Log in to reply
 

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