algo — C++23 日本語リファレンス GitHub

z_algorithm

関数 · Z algorithm

template <class Container>
std::vector<int> z_algorithm(const Container &s);

概要

Z algorithm

Z[i] := S[i:Z[i]] == S[0:Z[i]-i]

計算量

参照