Implement Queue Using Array

Implement a queue using an array and execute a sequence of operations.

You are given two parallel arrays, operations and values, of equal length. For each index i:

  • enqueue(x) when operations[i] == "enqueue": push values[i] to the back of the queue.
  • dequeue() when operations[i] == "dequeue": remove the front element if present (no output).
  • front() when operations[i] == "front": append the front element to the output, or -1 if the queue is empty.
  • empty() when operations[i] == "empty": append 1 if the queue is empty, otherwise 0.

For non-enqueue operations, values[i] is a placeholder 0 and must be ignored.

Return the output array in order.

Examples
Input: [["enqueue","enqueue","front","dequeue","front"],[1,2,0,0,0]]
Output: [1,2]
Hints

Implement Queue Using Array

Implement a queue using an array and execute a sequence of operations.