跳转至

2.1.1 Z-algo(扩展KMP)

本文 \(\text{0-indexed}\)

Z 函数

给定一个串 \(s\),其 Z 函数 \(z_i=\left|\operatorname{LCP}(\operatorname{suf}(i), s)\right|\),特别地 \(z_0=0\)