Digital Dictionary

Dont know which cases are failing,

Hey @coolio.boy385,

Your search logic will fail for test cases like:
4
pet
peter
rat
rack
8
pe
pet
r
rac
rat
hell
hello
h
Your Output:
pet
peter
pet
peter
rack
rat
rack
rat
No suggestions
hello
No suggestions
hell
hello
Expected Output:
pet
peter
pet
peter
rack
rat
rack
rat
No suggestions
No suggestions
hell
hello

Let me know if you still face any problem.
Hope, this would help.

Fixed that but no testcase passed

Hey @coolio.boy385,

The problem has not fixed yet:
Try to understand the mistake with the following example:
4
pet
peter
rat
rack
8
pe
pet
r
rac
rat
hell
hello
h
Expected Output:
pet
pett
peter
pet
pett
peter
rack
rat
rack
rat
No suggestions
No suggestions
hell
hello
Your Output:
peter
pett
peter
pett
rack
rat
rack
rat
No suggestions
No suggestions
hell
hello

Let me know, if you are stuck.

Hey @coolio.boy385,

I have modified your code, now it is working properly.

Give a like if you are satisfied.