Digital Dictionary Problem using Trie

My code is passing all sample test cases https://ide.codingblocks.com/s/75557
I have also taken care of Upper and Lower cases alphabets. Still it shows wring answer on Submission. Please help
Find the question here https://hack.codingblocks.com/contests/c/537/1560
I have also tried sorting the final vector https://ide.codingblocks.com/s/75555 but that did not help