LeetCodechevron_rightCategorieschevron_rightheap priority queue
label

heap priority queue

169 problems
Easy: 15Medium: 93Hard: 61

heap priority queue is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

Problem bank

heap priority queue problem bank

Start with a compact scan-friendly list and progressively load more so the topic page stays readable even when the corpus is large.

Progressive topic library

Built for large topic sets: scan the structure first, then go deeper.

hourglass_bottomScroll to continue
search
tuneDifficulty

Showing 24 / 169 problems

+24 per load
#TitleDifficulty
23

Merge k Sorted Lists

Merge k Sorted Lists requires efficiently combining multiple sorted linked lists into one using pointers and priority qu…

Hard
215

Kth Largest Element in an Array

Find the kth largest element in an unsorted array using optimal approaches like Quickselect or heaps.

Medium
218

The Skyline Problem

The Skyline Problem requires calculating a city's silhouette using array manipulation and divide-and-conquer techniques …

Hard
239

Sliding Window Maximum

Solve the "Sliding Window Maximum" problem using efficient techniques like the sliding window, deque, and priority queue…

Hard
264

Ugly Number II

Find the nth ugly number, where ugly numbers have prime factors limited to 2, 3, and 5.

Medium
295

Find Median from Data Stream

Implement a MedianFinder class that supports adding numbers and finding the median from a data stream.

Hard
347

Top K Frequent Elements

Find the k most frequent elements from an array using efficient algorithms like hashing and sorting.

Medium
355

Design Twitter

Design Twitter requires implementing post, follow, unfollow, and news feed retrieval using linked-list pointer manipulat…

Medium
373

Find K Pairs with Smallest Sums

Find K Pairs with Smallest Sums combines arrays and heap usage to select the smallest sum pairs efficiently.

Medium
378

Kth Smallest Element in a Sorted Matrix

Find the kth smallest element in a sorted n x n matrix using efficient binary search or heap strategies for optimized me…

Medium
407

Trapping Rain Water II

Solve Trapping Rain Water II using breadth-first search and priority queues for efficient water trapping in a matrix.

Hard
420

Strong Password Checker

The Strong Password Checker problem challenges you to optimize password strength while minimizing steps using greedy alg…

Hard
451

Sort Characters By Frequency

Sort Characters By Frequency requires counting characters efficiently and rearranging a string in descending frequency o…

Medium
480

Sliding Window Median

Compute the median for each sliding window of size k in an array using efficient array scanning and hash lookup techniqu…

Hard
502

IPO

Maximize total capital by selecting up to k projects, based on initial capital and project profits using a greedy strate…

Hard
506

Relative Ranks

Solve Relative Ranks by sorting scores with original indices, then writing medal labels or numeric places back in answer…

Easy
621

Task Scheduler

Task Scheduler is solved by counting task frequencies and computing how cooldown gaps force idle slots around the most f…

Medium
630

Course Schedule III

Solve the 'Course Schedule III' problem with a greedy approach involving course selection and validation of constraints.

Hard
632

Smallest Range Covering Elements from K Lists

Find the minimal range covering at least one number from each of k sorted lists using array scanning and hash lookup eff…

Hard
658

Find K Closest Elements

Identify the k integers closest to a target x in a sorted array using binary search and two-pointer strategies efficient…

Medium
659

Split Array into Consecutive Subsequences

Verify if it's possible to split a sorted array into consecutive subsequences of length 3 or more.

Medium
675

Cut Off Trees for Golf Event

Determine the minimum steps to cut all trees in a forest matrix in ascending height order using BFS traversal and priori…

Hard
692

Top K Frequent Words

Solve Top K Frequent Words by counting each word, then ordering ties alphabetically so frequency wins before lexicograph…

Medium
703

Kth Largest Element in a Stream

Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…

Easy

swap_vertScroll inside the bank to auto-load more

Related Patterns

Heap (Priority Queue) LeetCode Problems: 169 Solutions