Https://ide.codingblocks.com/s/333204

i have tried to implement this question without trie, but not able to figure out, where i’m going wrong. can u please help me?

hello @kodivine0
i think ur code is correct.
what issue u r facing?

wrong answer, not passed a single test case :slight_smile:

i dont have problem link , please share the problem link with me

https://online.codingblocks.com/app/player/65048/content/151609/5362/code-challenge this is the prob link

try this test case->
10
sher
sherlock
sherlocked
tardis
tardisblue
luck
lucifer
samdean
castiel
cassifer
8
lu
s
chuck
c
cas
sherl
tardisissexy
tard

correct output=>
lucifer
luck
samdean
sher
sherlock
sherlocked
No suggestions
cassifer
castiel
chuck
cassifer
castiel
sherlock
sherlocked
No suggestions
tardis
tardisblue
tardisissexy

check ur updated code->

u missed one case -> if searched word is not found then add that word in ur dictionary

in some test cases i’m getting tle, how can i avoid this?

try trie :sweat_smile::sweat_smile: … … …

can u tell me how to implement the search function?

refer this ->