You are viewing a single comment's thread. Return to all comments →
Python implementations:
n = int(input()) data = str() log = list() for i in range(n): operator = input() if len(operator.split()) == 2: op, w = operator.split() if op == '1': log.append(data) data += w elif op == '2': log.append(data) data = data[:-int(w)] elif op == '3': print(data[int(w) - 1]) else: data = log.pop()
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Text Editor
You are viewing a single comment's thread. Return to all comments →
Python implementations: