0
Input: The first line will consists of one integer T denoting the number of test cases. For each test case: 1) The first line co
Sample Input 1 5 2 1 2 3 4 5 Sample Output 4 5 1 2 3 Explanation Here T is 1, which means one test case. N=5 denoting the number of elements in the array and K=2 , denoting the number of steps of rotations. The initial array is: 1,2,3,4,5 In first rotation, 5 will come in the first position and all other elements will move to one position ahead from their current position. Now, the resultant array will be 5,1,2,3,4 In second rotation, 4 will come in the first position and all other elements will move to one position ahead from their current position. Now, the resultant array will be 4,5,1,2,3
3 Respuestas
+ 4
Looks very homework like. Let's begin with something from your part first, you write some code, share it here, then people help you with the thing you find to be difficult.
Just FYI, people here help when they see an effort from your side. So if you have that code, just share your try here, then your chances for answer will be better. Doesn't matter if your code has bug or does not work, what matter is your try ...
0
gg
0
Hrishabh Gupta
Your question appears to be homework / assignment. Please show us your attempt, the community is not here to do your work for you.
Please use the forum guidelines provided below and use the 8 rules for getting help from the community.
https://www.sololearn.com/Blog/38/8-simple-rules-to-get-help-from-the-community
Your question will be reviewed by the mod-team and mostly likely will be marked for deletion.
https://www.sololearn.com/Discuss/1316935/?ref=app