#abc233b. B - A Reverse

B - A Reverse

Score : 200200 points

问题描述

你将获得三个整数 LLRR 以及一个由小写英文字母组成的字符串 SS
请打印该字符串,但其中第 LL 个至第 RR 个字符的顺序反转后的内容。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given integers LL, RR, and a string SS consisting of lowercase English letters.
Print this string after reversing (the order of) the LL-th through RR-th characters.

Constraints

  • SS consists of lowercase English letters.
  • 1S1051 \le |S| \le 10^5 (S|S| is the length of SS.)
  • LL and RR are integers.
  • 1LRS1 \le L \le R \le |S|

Input

Input is given from Standard Input in the following format:

LL RR

SS

Output

Print the specified string.

Sample Input 1

3 7
abcdefgh

Sample Output 1

abgfedch

After reversing the 33-rd through 77-th characters of abcdefgh, we have abgfedch.

Sample Input 2

1 7
reviver

Sample Output 2

reviver

The operation may result in the same string as the original.

Sample Input 3

4 13
merrychristmas

Sample Output 3

meramtsirhcyrs

update @ 2024/3/10 10:08:29