Preface about Suffix Arrays
suffix array is clam? ? , suffix arrays are a very powerful tool for working with strings.
I think suffix arrays are more practical than suffix automata.
The suffix array is to sort all the suffixes of a string and store them in an array.
This amazing data structure can handle things like...
Find the longest common prefix of any two suffixes
The number of different substrings
Longest repeating substring (can overlap)
longest repeating substring (non-overlapping)
longest common substring
longest palindromic substring
Problem with multiple strings
Without further ado, let's get to the point! !
1. Construction of suffix array