Part Sort
Submissions: 6913   Accuracy:

17.95%

  Difficulty: Basic   Marks: 1

Given an array A[N], you are required to sort the array in given index range [a, b], i.e., you need to sort subarray A[a..b]
Input : 
The first line of input contains an integer T denoting the Test cases. Then T test cases follow. 
The first line contains an integer N i.e number of array elements.
The second line contains array elements A[i]
The third line contains a and b

Output : 
For each test case, the output is the sorted array as per the given range [a, b] 

Constraints :
1 ≤ T ≤ 100
1 ≤ N ≤ 10^5
0 ≤ A[i] ≤ 10^6
0 ≤ a<=b ≤ N-1

Input : 
1
5
7 8 4 5 2
1 4

Output : 
7 2 4 5 8

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Mohit Gupta_OMG :)
Author: Mohit Gupta 4


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.