Suffix tree#4656

Suffix tree (Discussion)

  1. A1zbergDec 27, 2024, 9:48 PM

    I have 50 52 60 62 tests failing with wrong answer. Any tips?

  2. A1zbergDec 22, 2024, 11:19 AMedited

    Pay attention to the "4 2 4" from first example, 2 4 is "a$" vertex.

    Similar in last example "7 3 6" for "ba$".

    Worst case: "a...a$". Repeated letter seems to be the worst case because you want last "a$" to repeat as many times as possible, which happens when you repeat that letter. 2n-1. Wiki says worst is Fibonacci word, but from my tests it doesn't beat repeated letter. - It's not in the tests because when I tested locally my solution failed with stack overflow =)