Approach hintTry it first, then revealHide
After sorting the products, the words that start with a given prefix form one contiguous block. Binary search for each typed prefix and take up to three words, or store the best three words on every trie node.