Gro Intelligence processes ordered work items such as data refresh requests and alert evaluations. Implement a queue using two stacks, while preserving first-in, first-out behavior and achieving amortized O(1) time for each operation.
Write implement_queue(operations). Each operation is represented as an array. Supported operations are:
["enqueue", value]: Add value to the back of the queue. This operation produces no output.["dequeue"]: Remove and return the front value. The input will not dequeue from an empty queue.["peek"]: Return the front value without removing it. The input will not peek at an empty queue.["size"]: Return the current number of queued values.Return an array containing the results of dequeue, peek, and size operations in their original order. Do not include results for enqueue operations.
def implement_queue(operations):