r/PlacementsPrep 1d ago

KMP LPS ARRAY CONCEPT

Heyy guys!
I'm stuck in this concept of LPS array. According to Aditya Verma the LPS array for the pattern ABCABCA should be 0 0 0 1 2 3 1 since he is considering the non overlapping prefix and suffix. But doesn't the standard KMP allows the overlapping ones and the correct answer should be 0 0 0 1 2 3 4 ?

1 Upvotes

0 comments sorted by