HOW TO SOLVE MARCH LUNCHTIME PROBLEM "ABABAABA"

substring

#1

Looking for algorithm which solves the problem
https://www.codechef.com/problems/ABABAABA
in O(n).


#2

Why don’t you look at the editorial which is already provided here?


#3

thanks the link wasn’t there(with problem).