TASHIFT - Editorial

refer to this


[1] for above mentioned problem.


  [1]: https://www.codechef.com/viewsolution/13622248

Why are we concatenating B with B before applying the KMP algorithm?

Why do we need to append B to itself?

@upendra1234,
Take a test case :
9
abcabdfeg
abcabcabd.
Your accepted code is giving answer 0 , but the correct answer is 3 .

Please help me with my code , I have used KMP algorithm and I am getting a wrong answer.
Which might be the test cases getting wrong ??
https://www.codechef.com/viewsolution/14293528

could someone give me a counterexample for my code. iā€™m getting WA but cannot find a simple counterexample.
code: https://www.codechef.com/viewsolution/19812182