Trie interview problem

i am unable to do this question .pls tell the code.