Question link---->https://www.hackerearth.com/practice/data-structures/advanced-data-structures/trie-keyword-tree/practice-problems/algorithm/search-engine/description/
Code link is
https://ide.codingblocks.com/s/326527
I am getting TLE
Help!!
Search Engine Hackerearth
dfs call will definitely give TLE
it can be avoided by making one extra variable “weight” for each node
in “weight” you have to store the maximum till now
look at the code for better understanding
Reference Code
i hope this helps
if you want to ask something about this feel free to ask
else mark doubt as resolved
Ya Now Got AC…
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.