Quick Left Rotation
Submissions: 6676   Accuracy:

33.12%

  Difficulty: Basic   Marks: 1

Given an array of size n and multiple values around which we need to left rotate the array.

Input:
First line consists of T test case. First line of every test case consists of N and K, N denoting number of elements of array and K denoting the number of places to shift
. Second line of every test case consists of elements of array.

Output:
Single line output, print the rotated array.

Constraints:
1<=T<=100
1<=N<=10^4
1<=K<=10^4

Example:
Input:

1
5 14
1 3 5 7 9
Output:
9 1 3 5 7

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

Contributor: Saksham Raj Seth
Author: saksham seth


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.