Closed Shreya3554 closed 4 years ago
Adding to this question, should the word be labeled as a dictionary term via its endstate as well?
To my understanding, yes if the candidate is not already in the trie, it should be added with its endstate set to true. If the prefix is not in the trie, then it should be added to trie but the endstate will be false.
Thank you @skhardi for answering!
Replace
#
in the title with the appropriate homework number. For pickCandidate(prefix, candidate), if the candidate does not exist, do we need to add the candidate to the trie?