Why run error while doing submission?
@codingblockscpp
There are few mistakes in your code
- 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.
- if that string doesn’t exist in your tries, you have to insert it. So write t.insert(s) just after printing “No suggestion”.