http://codeforces.com/contest/798/problem/B .. in this question , can somebody please explain how to find the minimum number of moves to make the two strings equal . for example  "ozozizc" and "zcozozi" .... thanks in advance asked 22 Apr '17, 10:34

The editorial has a dynamic programming solution as provided by @only4, but I solved it with an alternate brute force approach. Considering your example, let $A$ be "ozozizc" and $B$ be "zcozozi" and assume that we want to turn $A$ into $B$ using cyclic left shifts as instructed in the statement. Now a string of length $m$ has exactly $m$ rotations that can be obtained by cyclic shifts. So the final string we turn all our given strings into must be one of these $m$ strings. The total complexity depends on the complexity of locating $B$ in $C$ in the procedure described above. If a naive string matching algorithm is used the total complexity is $\mathcal{O}(S^3 \times n)$. A linear string matching algorithm reduces it to $\mathcal{O}(S^2 \times n)$. answered 22 Apr '17, 16:29

You can find the editorials here http://codeforces.com/blog/entry/51652