You are viewing a single comment's thread. Return to all comments →
Python
a = int(input("")) queue = [] for i in range(a): b = list((input("").split(" "))) if b[0] == str(1): queue.append(b[1]) elif b[0] == str(2): if queue is None: break del queue[0] elif b[0] == str(3): if queue: print(queue[0]) print(queue)
Queue using Two Stacks
You are viewing a single comment's thread. Return to all comments →
Python
easy to understand