CreativeAss's blog

By CreativeAss, history, 6 years ago, In English

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

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

| Write comment?
»
6 years ago, # |
  Vote: I like it +5 Vote: I do not like it

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.