Digital dictionary, Worng Answer

Hello @sk14452,

The logic of your code is correct.
The answer is coming wrong because there is a missing statement in the question.

You have to insert the prefix into the trie if there is no string present in the trie corresponding to this prefix.
i.e. the case when you have to print “No Suggestions”
I have informed your mentors about the same. They’ll soon correct it.

You can check your modified code here:

Hope, this would help.
Give a like, if you are satisfied.

Dude! Wasted 3 hours on that question.

I can understand.:slightly_smiling_face:

Even I wasted my two days, figuring this out.
I have raised this issue to your mentors, they will soon change it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.