Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Letter Queue by _Chico_
def letter_queue(commands):
queue = ""
for command in commands:
if command == "POP":
if queue:
queue = queue[1:]
elif command.startswith("PUSH"):
queue += command.split()[1]
return queue
July 10, 2021
Comments: