In the editorial of the problem Pasha and String, the author makes a claim that, “it doesn’t matter in which order make reverses, answer will be the same for all orders.”

What is the reasoning behind this statement? Is it because the rotation of string is always symmetric about the center(from the position i to |s| - i + 1)?

# Help in Codeforces problem Pasha and String

**sorb1997**#1

**meooow**#2

Yes, that is correct. A rotation causes changes in positions of characters, but a character at i is always swapped with that at |s|-i+1. So the only thing which is important with regard to a pair of positions (i, |s|-i+1) is the number of rotations that affect them.