TRIE Problem - An Optimized Approach Required.

Hi guys, I was doing this problem on hacker rank related to Trie Data Structure. Required operations were working fine, but during the run, most of the test cases timed out. I need your advice in optimizing the data structure, so that retrievals can be made faster. Here is the Link to the code

It was simple :P. This helped :slight_smile: *Incase any gets the same problem in future