Please help me with this

If we got to know that the given query is present, then how to print all the words that are in that lane

for this you have to make an string out
and then while going down append the char to out

you can see this code for reference purpose only
first try at your own

Reference Code

if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with :heart: and don’t forgot to mark doubt as resolved

@Saurabh Joshi…I’ve one doubt in your code, suggestions function after writing “No suggestions” why are you inserting that query to the trie

why can’t we jst return after outputting “No suggestions”

https://ideone.com/yLJ9xx.Why this code is not passing any of the test cases, but passes the sample test case, I’ve checked it multiple time but couldn’t find the issue

this is because it is mention in the question

And if no such words are available for a given search word, add this word to your dictionary.

Got it!! Thnx bhaiii