Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

netflix's blog

By netflix, history, 4 years ago, In English,

In this question I am applying DFS to solve it. I go down to the lowest level of any word. Then again I apply DFS from the next word. But I am being given TLE on test case 29 continuously. In test case 29, there is only one string with no children : string,0 (something like this). Can someone help me with my code or is my complexity itself too high for my solution to be correct. Here is my solution link : http://ideone.com/hiaumA . Thank-you in advance.

 
 
 
 
  • Vote: I like it
  • -8
  • Vote: I do not like it