Hi Guys,
I am trying to understand the editorial for this problem on prefix and suffix. The editorial is not very clear OR maybe it is clear and I am not able to understand it. What is prefix function p of string s ? It will be great if someone can explain the approach with an example.
Ok I found some blog on Z algorithm at http://codeforces.net/blog/entry/3107.
It will be great if you use /blog/entry/3107 instead of http://codeforces.net/blog/entry/3107 so that Russian users can open it directly.