Why run error while doing submission?

@codingblockscpp
There are few mistakes in your code

  1. If temp==NULL then t.DFS(temp,ans) would give segmentation fault. So you need to continue in that case.So simply write continue inside if(temp==NULL) condition.
  2. if that string doesn’t exist in your tries, you have to insert it. So write t.insert(s) just after printing “No suggestion”.

@codingblockscpp
I have updated your code and It is working fine for all testcases. Check it here

@codingblockscpp
Please mark this doubt as resolved.