End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
nums.k, remove elements until the size is exactly k.add operation, insert the new value val into the heap if the heap size is less than k or if val is greater than the root of the heap.k after insertion, remove the root of the heap.