Can someone explain Compressing a string from Prefix function - Knuth-Morris-Pratt - Algorithms for Competitive Programming with some diagram?
I am not clear about a solution.
- Why the final answer will be k not smaller.
- Cases
- In the last case how all strings will be equal?