LearnPy Hub
← Modules & the Standard Library problems
Hard

Rotate with deque

Read a line of integers and k. Use collections.deque.rotate(k) (positive k rotates right) and print the result.

Input

A line of integers, then k.

Output

One line.

Sample 1

Input
1 2 3 4 5
2
Output
4 5 1 2 3

Sample 2

Input
1 2 3
-1
Output
2 3 1
solution.py
Output appears here
Rotate with deque · Python practice problem · LearnPy Hub