Implement a heap-based priority queue with push, pop, peek, and size operations.
Constraints
Example
>>> h = MinHeap() >>> h.push(5) >>> h.push(3) >>> h.push(8) >>> h.peek() 3 >>> h.pop() 3 >>> h.pop() 5 >>> h.size() 1 >>> push_pop_order([5,3,8,1]) [1,3,5,8] >>> peek_after_push(7) 7 >>> size_after_operations([1,2,3]) 2
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints