Implement a MyQueue class that represents a first-in, first-out (FIFO) queue of integers.
The MyQueue class should support the following operations:
MyQueue() — Initialize an empty queue.enqueue(val) — Add the integer val to the back of the queue.dequeue() — Remove and return the element at the front of the queue. Return -1 if the queue is empty.front() — Return the element at the front of the queue without removing it. Return -1 if the queue is empty.isEmpty() — Return true if the queue is empty, false otherwise.size() — Return the number of elements in the queue.["MyQueue","enqueue","enqueue","enqueue","front","dequeue","size","isEmpty"]
[[],[1],[2],[3],[],[],[],[]][null,null,null,null,1,1,2,false]-1000 <= val <= 1000At most 1000 calls will be made to enqueue, dequeue, front, isEmpty, and sizedequeue and front return -1 when the queue is emptyRun your code to see results
Use Cmd+Enter to run