Wrong test case:Input: "abcd", ["a","abc","b","cd"], Output: false, Expected: true


  • 0
    C

    Leetcode result:

    Input: "abcd", ["a","abc","b","cd"]
    Output: false
    Expected: true

    I think this expcted should be false? Any one explain?


  • 0
    N

    You can wrap the input "abcd" by using:

    • "a" (first element)
    • "b" (third element)
    • "cd" (forth element)

  • 0
    C

    Input: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab", ["a","aa","aaa","aaaa","aaaaa","aaaaaa","aaaaaaa","aaaaaaaa","aaaaaaaaa","aaaaaaaaaa"]
    Output: true
    Expected: false


  • 0
    C

    My Visual Studio gave me the right answer, which is false. But leetcode gave me a wrong answer which is true. why? WRT the above test case.


  • 0
    C

    Thanks Nynq. You are right. I have fixed it. Ignore my following comments


Log in to reply
 

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