Back to Question

Design a Word Filter (Prefix/Suffix Search)

Question Explain

Design a data structure that supports searching for a word with a given `prefix` and `suffix` simultaneously. Consider using two Tries or a single specialized Trie.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.