Runtime error ans wrong answer

I have written the code and my code is giving all right answer but When I am going to submit it,it is giving wrong answer ans runtime error. link for the code: https://ide.codingblocks.com/s/225330

@Debugger
dry run your code for 6
app
apple
application
batman
batmobile
cat
7
ap
bat
batcave
bat
cat
appl
appledore

the ans should be
app
apple
application
batman
batmobile
No suggestions
batcave
batman
batmobile
cat
apple
application
No suggestions

what it is happenning??I have debugged the code but I am not able to figure out problem. pls help me

I have found the bug :slight_smile: thank you

1 Like

@Debugger mark your doubt as resolved and rate as well :slight_smile: