The idea of the problem is to take all the queries at first, insert the strings and store the id(s) in the trie. Then when searching for the strings we look at the id and if it is less than the id of that query, that means it has been inserted before this query and so the output is "YES" or else "NO".
Can you show me where the problem is? Useful testcases will also be appreciated.
Thanks in advance.
Problem link: ADAJOBS — Ada and Jobs
Code: Solution Code