← back

Heap (Priority Queue)

178 questions · 0 seen

All Heap (Priority Queue) problems

Problems

⊣ 23 Merge k Sorted Lists
⊣ 215 Kth Largest Element in an Array
⊣ 218 The Skyline Problem
⊣ 239 Sliding Window Maximum
⊣ 264 Ugly Number II
⊣ 295 Find Median from Data Stream
⊣ 332 Reconstruct Itinerary
⊣ 347 Top K Frequent Elements
⊣ 355 Design Twitter
⊣ 373 Find K Pairs with Smallest Sums
⊣ 378 Kth Smallest Element in a Sorted Matrix
⊣ 407 Trapping Rain Water II
⊣ 420 Strong Password Checker
⊣ 451 Sort Characters By Frequency
⊣ 480 Sliding Window Median
⊣ 502 IPO
⊣ 506 Relative Ranks
⊣ 621 Task Scheduler
⊣ 630 Course Schedule III
⊣ 632 Smallest Range Covering Elements from K Lists
⊣ 658 Find K Closest Elements
⊣ 659 Split Array into Consecutive Subsequences
⊣ 675 Cut Off Trees for Golf Event
⊣ 692 Top K Frequent Words
⊣ 703 Kth Largest Element in a Stream
⊣ 743 Network Delay Time
⊣ 767 Reorganize String
⊣ 778 Swim in Rising Water
⊣ 786 K-th Smallest Prime Fraction
⊣ 787 Cheapest Flights Within K Stops
⊣ 855 Exam Room
⊣ 857 Minimum Cost to Hire K Workers
⊣ 862 Shortest Subarray with Sum at Least K
⊣ 871 Minimum Number of Refueling Stops
⊣ 882 Reachable Nodes In Subdivided Graph
⊣ 912 Sort an Array
⊣ 973 K Closest Points to Origin
⊣ 1046 Last Stone Weight
⊣ 1054 Distant Barcodes
⊣ 1094 Car Pooling
⊣ 1172 Dinner Plate Stacks
⊣ 1263 Minimum Moves to Move a Box to Their Target Location
⊣ 1268 Search Suggestions System
⊣ 1337 The K Weakest Rows in a Matrix
⊣ 1338 Reduce Array Size to The Half
⊣ 1353 Maximum Number of Events That Can Be Attended
⊣ 1354 Construct Target Array With Multiple Sums
⊣ 1368 Minimum Cost to Make at Least One Valid Path in a Grid
⊣ 1383 Maximum Performance of a Team
⊣ 1388 Pizza With 3n Slices
⊣ 1405 Longest Happy String
⊣ 1424 Diagonal Traverse II
⊣ 1425 Constrained Subsequence Sum
⊣ 1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
⊣ 1439 Find the Kth Smallest Sum of a Matrix With Sorted Rows
⊣ 1464 Maximum Product of Two Elements in an Array
⊣ 1488 Avoid Flood in The City
⊣ 1499 Max Value of Equation
⊣ 1514 Path with Maximum Probability
⊣ 1606 Find Servers That Handled Most Number of Requests (PRO)
⊣ 1631 Path With Minimum Effort
⊣ 1642 Furthest Building You Can Reach
⊣ 1648 Sell Diminishing-Valued Colored Balls
⊣ 1675 Minimize Deviation in Array (PRO)
⊣ 1686 Stone Game VI
⊣ 1687 Delivering Boxes from Storage to Ports
⊣ 1696 Jump Game VI
⊣ 1705 Maximum Number of Eaten Apples
⊣ 1738 Find Kth Largest XOR Coordinate Value (PRO)
⊣ 1753 Maximum Score From Removing Stones
⊣ 1776 Car Fleet II
⊣ 1786 Number of Restricted Paths From First to Last Node
⊣ 1792 Maximum Average Pass Ratio (PRO)
⊣ 1801 Number of Orders in the Backlog
⊣ 1825 Finding MK Average
⊣ 1834 Single-Threaded CPU (PRO)
⊣ 1845 Seat Reservation Manager
⊣ 1851 Minimum Interval to Include Each Query (PRO)
⊣ 1878 Get Biggest Three Rhombus Sums in a Grid
⊣ 1882 Process Tasks Using Servers (PRO)
⊣ 1912 Design Movie Rental System
⊣ 1942 The Number of the Smallest Unoccupied Chair
⊣ 1962 Remove Stones to Minimize the Total (PRO)
⊣ 1985 Find the Kth Largest Integer in the Array
⊣ 2034 Stock Price Fluctuation
⊣ 2054 Two Best Non-Overlapping Events
⊣ 2099 Find Subsequence of Length K With the Largest Sum
⊣ 2102 Sequentially Ordinal Rank Tracker
⊣ 2146 K Highest Ranked Items Within a Price Range
⊣ 2163 Minimum Difference in Sums After Removal of Elements
⊣ 2182 Construct String With Repeat Limit
⊣ 2203 Minimum Weighted Subgraph With the Required Paths
⊣ 2208 Minimum Operations to Halve Array Sum
⊣ 2231 Largest Number After Digit Swaps by Parity
⊣ 2233 Maximum Product After K Increments
⊣ 2285 Maximum Total Importance of Roads
⊣ 2290 Minimum Obstacle Removal to Reach Corner
⊣ 2333 Minimum Sum of Squared Difference
⊣ 2335 Minimum Amount of Time to Fill Cups
⊣ 2336 Smallest Number in Infinite Set
⊣ 2342 Max Sum of a Pair With Equal Sum of Digits
⊣ 2343 Query Kth Smallest Trimmed Number
⊣ 2344 Minimum Deletions to Make Array Divisible
⊣ 2349 Design a Number Container System
⊣ 2353 Design a Food Rating System
⊣ 2357 Make Array Zero by Subtracting Equal Amounts
⊣ 2386 Find the K-Sum of an Array
⊣ 2398 Maximum Number of Robots Within Budget
⊣ 2402 Meeting Rooms III
⊣ 2406 Divide Intervals Into Minimum Number of Groups
⊣ 2424 Longest Uploaded Prefix
⊣ 2454 Next Greater Element IV
⊣ 2456 Most Popular Video Creator
⊣ 2462 Total Cost to Hire K Workers
⊣ 2497 Maximum Star Sum of a Graph
⊣ 2500 Delete Greatest Value in Each Row
⊣ 2503 Maximum Number of Points From Grid Queries
⊣ 2512 Reward Top K Students
⊣ 2530 Maximal Score After Applying K Operations
⊣ 2532 Time to Cross a Bridge
⊣ 2542 Maximum Subsequence Score
⊣ 2551 Put Marbles in Bags
⊣ 2558 Take Gifts From the Richest Pile
⊣ 2577 Minimum Time to Visit a Cell In a Grid
⊣ 2593 Find Score of an Array After Marking All Elements
⊣ 2611 Mice and Cheese
⊣ 2617 Minimum Number of Visited Cells in a Grid
⊣ 2642 Design Graph With Shortest Path Calculator
⊣ 2662 Minimum Cost of a Path With Special Roads
⊣ 2679 Sum in a Matrix
⊣ 2699 Modify Graph Edge Weights
⊣ 2762 Continuous Subarrays
⊣ 2812 Find the Safest Path in a Grid
⊣ 2813 Maximum Elegance of a K-Length Subsequence
⊣ 2931 Maximum Spending After Buying Items
⊣ 2940 Find Building Where Alice and Bob Can Meet
⊣ 2944 Minimum Number of Coins for Fruits
⊣ 2959 Number of Possible Sets of Closing Branches
⊣ 2973 Find Number of Coins to Place in Tree Nodes
⊣ 2974 Minimum Number Game
⊣ 3013 Divide an Array Into Subarrays With Minimum Cost II
⊣ 3049 Earliest Second to Mark Indices II
⊣ 3066 Minimum Operations to Exceed Threshold Value II
⊣ 3080 Mark Elements on Array by Performing Queries
⊣ 3081 Replace Question Marks in String to Minimize Its Value
⊣ 3092 Most Frequent IDs
⊣ 3112 Minimum Time to Visit Disappearing Nodes
⊣ 3123 Find Edges in Shortest Paths
⊣ 3170 Lexicographically Minimum String After Removing Stars
⊣ 3264 Final Array State After K Multiplication Operations I
⊣ 3266 Final Array State After K Multiplication Operations II
⊣ 3275 K-th Nearest Obstacle Queries
⊣ 3286 Find a Safe Walk Through a Grid
⊣ 3296 Minimum Number of Seconds to Make Mountain Height Zero
⊣ 3318 Find X-Sum of All K-Long Subarrays I
⊣ 3321 Find X-Sum of All K-Long Subarrays II
⊣ 3341 Find Minimum Time to Reach Last Room I
⊣ 3342 Find Minimum Time to Reach Last Room II
⊣ 3362 Zero Array Transformation III
⊣ 3377 Digit Operations to Make Two Integers Equal
⊣ 3408 Design Task Manager
⊣ 3462 Maximum Sum With at Most K Elements
⊣ 3478 Choose K Elements With Maximum Sum
⊣ 3505 Minimum Operations to Make Elements Within K Subarrays Equal
⊣ 3507 Minimum Pair Removal to Sort Array I
⊣ 3510 Minimum Pair Removal to Sort Array II
⊣ 3572 Maximize Y‑Sum by Picking a Triplet of Distinct X‑Values
⊣ 3594 Minimum Time to Transport All Individuals
⊣ 3604 Minimum Time to Reach Destination in Directed Graph
⊣ 3607 Power Grid Maintenance
⊣ 3620 Network Recovery Pathways
⊣ 3645 Maximum Total from Optimal Activation Order
⊣ 3650 Minimum Cost Path with Edge Reversals
⊣ 3691 Maximum Total Subarray Value II
⊣ 3767 Maximize Points After Choosing K Tasks
⊣ 3780 Maximum Sum of Three Numbers Divisible by Three
⊣ 3781 Maximum Score After Binary Swaps
⊣ 3815 Design Auction System