Longest Repeat — Solution & Editorial
The longest repeated substring is the maximum LCP between two suffixes — i.e. the maximum value in the LCP array of the suffix array.
Complexity: O(n log n)
The longest repeated substring is the maximum LCP between two suffixes — i.e. the maximum value in the LCP array of the suffix array.
Complexity: O(n log n)