CRANGIRL -A simple question based on z -algorithm

This is a simple question based on implementation of Z algorithm but i am getting wrong answer.
Can any one point out the bug or is there any tricky boundary case?
This is my submission:
thSLKc - Online C++0x Compiler & Debugging Tool - Ideone.com

1 Like