Question: 31
(Choose 1 answer)
What does the following function do when given an array of integers as input?
def fn(arr, k):
queue deque(arr)
for _in range(k):
queue.append(queue.popleft())
return list(queue)
If the input is [10, 20, 30, 40, 50] and k = 2, what will be the output?
A. [40, 50, 10, 20, 30]
B. [30, 40, 50, 10, 20]
C. [20, 30, 40, 50, 10]
D. [50, 10, 20, 30, 40]