Implement a priority queue.
Asked in the Phone screen stage. Coding portion of ~45 min initial phone screen.
Implement priority_queue(operations). Each operation is a map with type, and push operations also include value and integer priority. Support push, peek, and pop. The queue must return the value with the smallest priority first. If multiple values have the same priority, return them in insertion order. peek and pop return null when the queue is empty. Return an array containing the result of every peek and pop operation.
def priority_queue(operations):