Блог пользователя CreativeAss

Автор CreativeAss, история, 6 лет назад, По-английски

We can find out the total number of distinct substrings in the string by substracting the LCP (longest common prefix) of the suffix at each index with the suffix at the previous index.

Can someone help me in proving this?

Thanks in advance

Happy Coding

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Here is an article explaining the logic behind the method: e-maxx-eng — Suffix Array. It's not too long, but I think it should be enough.