From cb5ba4fefc7b7a83c319cb3a59e6853fb6602c83 Mon Sep 17 00:00:00 2001 From: Himanshu Gupta <107400207+himanshugupta09@users.noreply.github.com> Date: Mon, 3 Apr 2023 21:48:20 +0530 Subject: [PATCH] Create monk-and-rotation.py --- HackerEarth/monk-and-rotation.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 HackerEarth/monk-and-rotation.py diff --git a/HackerEarth/monk-and-rotation.py b/HackerEarth/monk-and-rotation.py new file mode 100644 index 0000000..7e10dba --- /dev/null +++ b/HackerEarth/monk-and-rotation.py @@ -0,0 +1,9 @@ +for _ in range(int(input())): + n,k = map(int,input().split()) + lst = list(map(int,input().split())) + idx = n-(k%n) + for i in range(idx,n): + print(lst[i],end = " ") + for i in range(idx): + print(lst[i],end = " ") + print()