TRIE Problem - An Optimized Approach Required.

binary-tree
data-structure
datastructure
dfs
dfs-order
trie
tries

#1

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