Grokking the Coding Interview: Patterns for Coding Questions
0% completed
Solution: Design Add and Search Words Data Structure
.....
.....
.....
Like the course? Get enrolled and start learning!
A
Anonymous
· 3 years ago
For example #1 in the Justification section, "banana" does not match the "....." pattern.
For example #3 in the Expected Output section, the expected output for ["h...o"] should be 1, not 0.
Show 1 reply
A
Anonymous
· 3 years ago
In python, I think my code works well, but the test cases seem not well organized.
In word match case, the function returns true, but the test code prints "0", instead of "1" in the expected result:
Your Input ["Solution","addWord","addWord","addWord","search","search","search","search"] [[],["apple"],["banana"],["cherry"],["apple"],["ban..a"],["cherr."],["b.n.n."]] Output [-1,-1,-1,-1,0,0,0,0] Expected [-1,-1,-1,-1,1,1,1,1]
Show 2 replies
Reading Progress
0%