Confusion with This Problem


  • 0
    I have no idea what's exactly the rules that we should use to derive the alphabet order?

    (1) If it's the relative order of each two words,

    ie. 
    ["wrt","wrf","er","ett","rftt"]
    "wrt"<"wrf"  ->  't'<'f'
    "wrf"<"er"   ->   'w'<'e'
    ...
    

    Then, for cases like ["abcd"], ["z","z"] should output nothing cause we can't derive from one word.

    (2) If it's the from each word we derive the rules

    ie.
    ["wrt","wrf","er","ett","rftt"]
    "wrt"   ->  'w'<'r'<'t'
    "wrf"   ->   'w'<'r'<'f'
    ...
    

    Then, the answer should not be "wertf" cause from "rftt" we can derive 'f'<'t'.

    (3) Combine the two rules above

    Then, there are still outlier cases.
    Like ["abcd","ef"], the expected answer is somehow "abcdfe"


  • 0

    (1) You do know something. You know which letters they use. And you should output them.

    (2) It's not from each word. If you see "cat" in the English dictionary, what does that tell you about the English alphabet? Does it tell you that "c" comes before "a" in the English alphabet?

    (3) In that case, you know they use those six letters and you know that "a" comes before "e" in their alphabet. The expected answer does fulfill that.


Log in to reply
 

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