Do I misunderstand the question?


  • 1
    S

    The input
    [
    "wrt",
    "wrf",
    "er",
    "ett",
    "rftt"
    ]

    The given correct answer is "wertf". But the last word in the input is "rftt", 'f' is in front of 't'. The given correct answer should be wrong, because 'f' is behind of 't'.

    Is there something wrong?


  • 1

    You misunderstand.

    the last word in the input is "rftt", 'f' is in front of 't'

    If you see the word "cat" in an English dictionary, do you then think that "c" comes before "a" in the English alphabet?


  • 0
    H

    How about the case:
    input: ["wnlb"] output: "blnw"?

    There is no way we can get the order of chars in this input, so I treat the order invalid and return "", but the oj gives error.

    Oj treats it as a valid input, and return "blnw"


  • 0

    @hpplayer It's not invalid (like for example ["a","b","a"]) but has multiple valid orders. So you shouldn't use note 2 but note 3.


Log in to reply
 

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