Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
list solution in Clear category for Letter Queue by Phil15
def letter_queue(commands):
L = []
for cmd in commands:
if cmd=='POP' and L:
L.pop(0)
elif cmd.startswith('PUSH'):
L.append(cmd[-1])
return ''.join(L)
Oct. 12, 2018
Comments: