Please help to debug the code.
Facing some problem with the code
Follow these steps:
- Make a trie containing characters of strings.
- For each word in query first go till the end char of this word in trie and then push all words that can be made using chars in the subtree of this last char and sort these words in lexiographical order and print it.