Heap / Priority Queue Pattern

Always extract min/max in logarithmic time.

#Title
23Merge k Sorted Lists
264Ugly Number II
295Find Median from Data Stream
313Super Ugly Number
347Top K Frequent Elements
355Design Twitter
358Rearrange String k Distance Apart
373Find K Pairs with Smallest Sums
378Kth Smallest Element in a Sorted Matrix
407Trapping Rain Water II
480Sliding Window Median
502IPO
632Smallest Range
692Top K Frequent Words
703Kth Largest Element in a Stream
846Hand of Straights
855Exam Room
973K Closest Points to Origin
1046Last Stone Weight
1057Campus Bikes
1229Meeting Scheduler
1235Maximum Profit in Job Scheduling
1353Maximum Number of Events That Can Be Attended
1354Construct Target Array With Multiple Sums
1383Maximum Performance of a Team
1642Furthest Building You Can Reach
1675Minimize Deviation in Array
1705Maximum Number of Eaten Apples
1792Maximum Average Pass Ratio
1801Number of Orders in the Backlog
1845Seat Reservation Manager
1851Minimum Interval to Include Each Query
1882Process Tasks Using Servers
1942The Number of the Smallest Unoccupied Chair
1962Remove Stones to Minimize the Total
2034Stock Price Fluctuation
2054Two Best Non-Overlapping Events
2158Amount of New Area Painted Each Day
2163Minimum Difference in Sums After Removal of Elements
2208Minimum Operations to Halve Array Sum
2233Maximum Product After K Increments
2254Design Video Sharing Platform
2263Make Array Non-decreasing or Non-increasing
2336Smallest Number in Infinite Set
2386Find the K-Sum of an Array
2402Meeting Rooms III
2462Total Cost to Hire K Workers
2503Maximum Number of Points From Grid Queries
2519Count the Number of K-Big Indices
2530Maximal Score After Applying K Operations
2532Time to Cross a Bridge
2542Maximum Subsequence Score
2558Take Gifts From the Richest Pile
2594Minimum Time to Repair Cars
2599Make the Prefix Sum Non-negative
2813Maximum Elegance of a K-Length Subsequence
2818Apply Operations to Maximize Score
2835Minimum Operations to Form Subsequence With Target Sum
2931Minimum Equal Sum of Two Arrays After Replacing Zeros
2940Find Building Where Alice and Bob Can Meet
3013Divide an Array Into Subarrays With Minimum Cost II
3049Earliest Second to Mark Indices II
3066Minimum Operations to Exceed Threshold Value II
3080Mark Elements on Array by Performing Queries
3081Replace Question Marks in String to Minimize Its Value
3092Most Frequent IDs
3256Maximum Value Sum by Placing Three Rooks I
3257Maximum Value Sum by Placing Three Rooks II
3264Final Array State After K Multiplication Operations I
3266Final Array State After K Multiplication Operations II
3275K-th Nearest Obstacle Queries
3296Minimum Number of Seconds to Make Mountain Height Zero
3362Zero Array Transformation III
3391Design a 3D Binary Matrix with Efficient Layer Tracking
3478Choose K Elements With Maximum Sum
3506Find Time Required to Eliminate Bacterial Strains
3684Maximize Sum of At Most K Distinct Elements
3691Maximum Total Subarray Value II
3711Maximum Transactions Without Negative Balance
3781Maximum Score After Binary Swaps
3801Minimum Cost to Merge Sorted Lists
3815Design Auction System
3885Design Event Manager
3892Minimum Operations to Achieve At Least K Peaks
3962Maximum Subarray Sum After at Most K Swaps