Digital Dictionary


for ‘r’ segmentation fault is coming …where is the problem in this code?

@pearlgupta2000
Its because inside fun() function, when you are looping for(auto i : temp->m) but inside this loop you are changing the temp variable which you will futher need to run the loop.
So don’t change temp, rather make another variable, and use that further.

Also in case of No suggestion, you need to insert the string into the trie as given in question.

my code is working fine now …but TLE is coming(https://ide.codingblocks.com/s/237667)

https://ide.codingblocks.com/s/237667…

can u provide me the code for this ques please?

@pearlgupta2000 have a look at this code, i have done the required changes in your code.

I added comments for better understanding.
You can ask if you have any doubts now.
Otherwise please mark this doubt as resolved.