Click here to see the full article post
For the second method using Trie, Why is time complexity O ( n ) ?
For each word in the sentence, we search through the trie every-time and
time require required to search in trie is O ( length of the word ), shouldn't it be
- Total time complexity = O ( total_words_in_sentence * avg_length_of_word )
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.