Hi codeforces,
I was attempting to solve the KMP problem below, but I'm failing on testcase 3.When I run the testcase locally, I am getting the correct answer on my machine. Could somebody help spot the bug that is probably causing undefined behaviour?
Problem: http://mirror.codeforces.com/contest/471/problem/D Solution: http://mirror.codeforces.com/contest/471/submission/31585259