Living_Tribunal's blog

By Living_Tribunal, history, 5 years ago, In English

This question appeared in a contest on hacerrank.

Any ideas on how to solve this tree problem efficiently? I got only 57.14 points with my binary search and preorder-pattern matching approach.

Here's my approach

I'm asking for your help and approach because no submissions are available to see.

  • Vote: I like it
  • +5
  • Vote: I do not like it

| Write comment?
»
5 years ago, hide # |
 
Vote: I like it -17 Vote: I do not like it

SecondThread orz Errichto please help with this. I know red coders are busy and shouldn't tag them, but I need help and this problem seems tough. If you think it's too easy, just tag someone else (like yellow maybe).

Here's what I've tried:

  • Even I've solved the O(n^2 log N) thing using binary search.

  • I also tried serializing the tree and using suffix automaton to solve the longest duplicate substring on it, but seems like it won't work.