You are viewing a single comment's thread. Return to all comments →
q = [] for s in [input() for _ in range(int(input()))]: q.append(s[2:]) if s[0] == '1' else q.pop(0) if s == '2' else print(q[0]) if s == '3' else ...
Seems like cookies are disabled on this browser, please enable them to open this website
Queue using Two Stacks
You are viewing a single comment's thread. Return to all comments →