Do you know algorithm/data structure that can be used to find prefix function of substring s[l..r] fast? I need it in a problem with many queries.
Do you know algorithm/data structure that can be used to find prefix function of substring s[l..r] fast? I need it in a problem with many queries.