"Dog" Test Case Wrong?

  • 2


    This should return [true, true, true, true, true]. I don't understand why it will be [false, false, false,true,true]

  • -1

    d1g exists but dig/dug are not in the dictionary, so it returns false.

  • 0

    But in the example it says:

    Given dictionary = [ "deer", "door", "cake", "card" ]
    isUnique("dear") -> false
    isUnique("cart") -> true
    isUnique("cane") -> false
    isUnique("make") -> true

    "make" is not in the given dictionary but it returns true.

  • 0

    Based on the given example, I think the test case is right. But description should be more detailed. Take a look at case isUnique("cane") -> false, it keeps same abbr with cake but the result is false. I seems that if current word has the same abbr with some word in dict, they should be same word.

Log in to reply

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