I have written the Brute force Code here https://ide.codingblocks.com/s/76716 which is passing only one test case. I cannot think of how to use Trie in this question, nor can I find any help video for this question in the online course. Can someone please elpain the Trie approach ?
Also another small clarification, The Range L, R means both inclusive or not ? The question didn’t make it clear.