You are viewing a single comment's thread. Return to all comments →
python solution:
query =[] number_of_queries = int(input()) for q in range(number_of_queries): operation = input().split() if len(operation) == 2: query.append(operation[1]) elif len(operation) == 1 and operation[0] != '3': query.remove(query[0]) elif operation[0] == '3': print(query[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: