Right Rotation · Compiler
Right Rotation
Rotate a row of names k slots to the right. Each one-slot rotation moves the last name to the front and shifts every other name one slot right.
- Input
- Line 1 contains n (1 to 100) and k (0 to 1000000). Line 2 contains n space-separated names of 1 to 12 lowercase ASCII letters each.
- Output
- Print the names in their final order on one line, separated by spaces.
Compiler Explorer runs your code when you run or check it.
Loading your exercise draft…