このSuffix Arrayを走査して、横幅が最大となるような「同じ文字列が並んだ長方形」部分、を見つければよいのですが、 ただ単に並んでいればいいわけではありません。 LCSの制約条件 先ほどのSuffix Arrayの図に、長方形を足しました。
The libsais library provides fast (see Benchmarks below) linear-time construction of suffix array (SA), generalized suffix array (GSA), longest common prefix (LCP) array, permuted LCP (PLCP) array, ...
This workflow lets you index a text dataset once and then instantly count how many times any substring appears in it. It serializes the dataset into a flat binary format, constructs a suffix array (a ...