You are viewing a single comment's thread. Return to all comments →
from collections import deque
N= int(input()) d=deque()
for _ in range(N): cmd,*args = input().split() getattr(d, cmd)(*map(int, args))
print(*d)
Seems like cookies are disabled on this browser, please enable them to open this website
Collections.deque()
You are viewing a single comment's thread. Return to all comments →
from collections import deque
N= int(input()) d=deque()
for _ in range(N): cmd,*args = input().split() getattr(d, cmd)(*map(int, args))
print(*d)