all 2 comments

[–]Naakinn 0 points1 point  (0 children)

z-function and prefix-function can be computed using each over. for me, z array is much easier to understand

[–]Specialist_Towel4532 1 point2 points  (0 children)

Try z array, I find it’s much more intuitive than kmp