Hi everybody!
Now I'm trying to solve a problem but i don't have any idea. Can someone help me, please? I'm thanks.
Problem: Given your string S and function F(S, i, j) = S(i + 1, j — 1) + rev(S(j, n)) + rev(S(1, i)).
With S(i, j) is substring S[i...j] (if i > j, string is empty) and rev(S(i, j)) reverse of substring S[i..j]
Now, given you 2 strings A and B are same length, you task to count pair i and j (1 <= i <= j <= n) so that F(A, i, j) = B.
Length of string A and B <= 3*10^5.
(My English is not good, Sorry.)