×

# Help in Codeforces problem Pasha and String

 0 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)? asked 20 Mar '18, 18:13 4★sorb1997 150●9 accept rate: 10%

 1 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. answered 20 Mar '18, 19:07 6★meooow ♦ 7.1k●7●18 accept rate: 48%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,000
×672
×643

question asked: 20 Mar '18, 18:13

question was seen: 185 times

last updated: 20 Mar '18, 19:07