You are viewing a single comment's thread. Return to all comments →
Here's my code:
from collections import deque res = deque() for i in range(int(input())): u = input().split() if not hasattr(res, u[0]): continue val = u[1] if len(u) > 1 else None if val: getattr(res, u[0])(val) else: getattr(res, u[0])() print(*res)
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 →
Here's my code: