The Suffix Tree data structure can quickly handle the string search compare, searching the longest repeated substring and the longest common substring, and Suffix Tree can handle a set of regular string sequences in the time complexity O (n log n) -
View it on GitHub