I am quite confident that my code is correct still gives wrong ans.
Code: https://ide.codingblocks.com/s/92900
Digital Dictionary (wrong ans)
I am attaching sample input and output for this problem.
Run your program for those inputs and resolve the problem that is producing wrong outputs.
https://drive.google.com/open?id=1RWnyrLfDFce3Qi_9THQYCN_PvL-AhuUm
Hopefully, this would help.
If your problem is solved, then mark this doubt as resolved.
Otherwise let me know if you are still facing the problem.
Could not correct my code. Please have a look at it.
You need to ignore the cases:
For eg, Pe and pe both are prefix to peter.
But, your program is failing to do so.
Hope, this would help.
Now, your code will pass all the test cases and i guarantee you this.
I have found the fault.
I know, it’s not mentioned in the problem.
But you have to update the dictionary i.e. insert the string that is not present in the dictionary.
just add a statement to insert the unmatched string in your code as shown below:
if(temp->m[s[i]]==NULL)
{
cout<<"No suggestions"<<endl;
insert(s);
return;
}
Give a like, if you are satisfied.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
I have been debugging my code for like 2 hrs. Please update the question
I was doing that every day.
Even i was not aware about this.
I somehow figured it out and have already conveyed this to the mentors.
They will update it soon.
You can give a like, if you are satisfied.
And mark it as resolved.