You are viewing a single comment's thread. Return to all comments →
python
n = int(input()) from collections import deque b = deque() def queue(a): if a[0] == 1: b.append(a[1]) elif a[0] == 2: b.popleft() elif a[0] == 3: print(b[0]) for _ in range(n): a = list(map(int, input().rstrip().split())) queue(a)
Queue using Two Stacks
You are viewing a single comment's thread. Return to all comments →
python