You are tasked with implementing a simple queue simulator that processes a sequence of queue operations. The queue should operate on a First-In-First-Out (FIFO) basis.
X
to the end of the queue. (No output for this operation.)-1
.-1
.A list of operations as strings (e.g., ["enqueue 5", "enqueue 3", "peek", "dequeue", "size"]
).
A list of outputs corresponding to the operations that produce a result (i.e., for dequeue
, peek
, and size
).
For the input:
["enqueue 10", "enqueue 20", "peek", "size", "dequeue", "dequeue", "dequeue"]
The output should be:
[10, 2, 10, 20, -1]
Implement your solution using the starter code provided below.