4 ms·
This is a classic use case for Aho-Corasick algorithm.
by sanxiyn 6y ago
This is a classic use case for Aho-Corasick algorithm.
- zemo 6y agoah, perfect. yeah this is what I had in my head: taking the word list and making a big trie and walking it as I read the input. I figured there was some prior art here but was struggling to google it. thanks!