Implement Queue Using Array

Implement a queue using an array with the following operations:

  • enqueue(x): Push element x to the back of queue
  • dequeue(): Removes the element from the front of queue
  • front(): Get the front element
  • empty(): Return whether the queue is empty

Given an array of operations and values, execute them and return the results.

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

Implement Queue Using Array

Implement a queue using an array with the following operations: