BETA

Difficulty Level: Basic

Submissions: 7353 Accuracy:

51.01%

Rotate Array by n elements
     

Given an array of size n, rotate it by d elements. 

Input: The first line of the input contains T denoting the number of testcases. First line of test case is the number of elements 'n' and elements 'd' to be rotated. Second line of test case will be the array elements.
Output: Rotated array is displayed to the user.


Constraints:

1 <=T<= 50
1 <=n<= 100
d<=n
1 <=arr[i]<= 100


Example:

Input:
2
5 2
1 2 3 4 5 
10 3
2 4 6 8 10 12 14 16 18 20

Output:
3 4 5 1 2
8 10 12 14 16 18 20 2 4 6

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

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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