Sort the Substring

3.4

5 votes
Ready, Sorting, Approved, Very-Easy
Problem

Given a string S, and two numbers N, M - arrange the characters of string in between the indexes N and M (both inclusive) in descending order. (Indexing starts from 0).

Input Format:
First line contains T - number of test cases.
Next T lines contains a string(S) and two numbers(N, M) separated by spaces.

Output Format:
Print the modified string for each test case in new line.

Constraints:

  • // |S| denotes the length of string.
Sample Input
3
hlleo 1 3
ooneefspd 0 8
effort 1 4
Sample Output
hlleo
spoonfeed
erofft
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?