Explanation of a testcase

  • 0

    For input: ["ab","adc"] I think the order should be "abdc", however the expected output is "abcd". Can someone please explain ?

    Since "d" is a prefix of "c", d should come before c. Or I am interpreting "You may assume that if a is a prefix of b, then a must appear before b in the given dictionary." incorrectly.

Log in to reply

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