Does . also represent "nothing"?


  • 0
    Y

    This is the test case:

    addWord("at"),addWord("and"),addWord("an"),addWord("add"),search("a"),search(".at"),addWord("bat"),search(".at"),search("an."),search("a.d."),search("b."),search("a.d"),search(".")

    The answer says search("a.d.") should return true. I do not understand this. There are no words of length 4 in the dictionary, and yet the answer says a.d. is in the dictionary.


Log in to reply
 

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