You are viewing a single comment's thread. Return to all comments →
Python solution
n = int(input()) lista = [] for i in range(n): x = input().split() if x[0] == "1": lista.append(x[1]) elif x[0] == "2": lista = lista[1:] else: print(lista[0])
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 →
Python solution