Queue Operations Simulator

Queue Data Structures Simulation

Problem Description

On this St. Patrick's Day, celebrate by coding a simple queue simulator! In this problem, you will be given a list of operations to perform on a queue. Each operation is represented as a string and can be one of the following:

  • ENQUEUE X: Add the integer X to the end of the queue.
  • DEQUEUE: Remove the integer from the front of the queue and output it. If the queue is empty, output -1.

Write a function that processes these operations in order and returns a list of integers corresponding to the output of each DEQUEUE operation.

Example

For the input operations:

["ENQUEUE 5", "ENQUEUE 10", "DEQUEUE", "DEQUEUE", "DEQUEUE"]

The output should be:

[5, 10, -1]

Function Signature

Your function should have the following signature (language-specific variations in the starter code):

  • Input: List of strings representing operations
  • Output: List of integers (results of each DEQUEUE operation)