0
In the Knuth–Morris–Pratt (KMP) algorithm, the prefix (failure) function π[i] is the length of the longest proper prefix of the pattern that is also a suffix of its first i characters. For the pattern ababaca, the sum π[1] + π[2] + … + π[7] is
- A7
- B6
- C5
- D8
Correct answer: A