Digital Dictionary

My sample test case is passing but it is giving wrong answer for all other test cases

You are adding word in line ‘69’ using addword() function. You should not do that as here you are only supposed to print the prefixes and show “No suggestions” is there is no prefix.
So in printWithPrefix () function you do not call addword() just print " NO suggestions" and return else print all the word that have prefix.

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.