Consider the following Python code.
from collections import deque
q = deque()
for x in [4, 7, 1, 9]:
q.append(x)
q.append(q.popleft() + q.popleft())
q.appendleft(q.pop())
print(list(q))
What does it print?
- A[1, 9, 11]
- B[10, 4, 7]
- C[11, 1, 9]
- D[11, 9, 1]