Wrong answer error

A number of testcases work alright in my code but I am still facing wrong answer errors. Please have a look at my code.
The approach was :
Firstly check the given substring
–> if its a proper word then print it
–> otherwise provide the node and the output so far ( OSF ) to the display function.

Here’s the link https://ide.codingblocks.com/s/178237

hi @mananaroramail
try to run your code for this test case
6
app
apple
application
batman
batmobile
cat
7
ap
bat
batcave
bat
cat
appl
appledore

Now I have updated the code. I forgot to add those words , which gave " no suggestions " as output. I am still facing wrong answer errors. Kindly have a look in the code.

hi @mananaroramail
you are still getting wrong output for the above test case
sample input ;
6
app
apple
application
batman
batmobile
cat
7
ap
bat
batcave
bat
cat
appl
appledore

sample output:
app
apple
application
batman
batmobile
No suggestions
batcave
batman
batmobile
cat
apple
application
No suggestions

please check your for this testcase.

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.