What is wrong in my code

Please tell me what is wrong in my code

Hello @sahazeer123,

Your code is failing for test cases like:
4
pet
peter
rat
rack
5
pe
pet
r
rac
rr
Your Output:
pet
peter
pet
peter
rack
rat
rack
Expected Output:
pet
peter
pet
peter
rack
rat
rack
No suggestions

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

1 Like

I am not able to figure out what is the error? Please help

Hello @sahazeer123,

You can refer to the following code to find error in your code:

If you still face any problem, let me know.
I’ll correct your code for you.