The NeetCode 150 LeetCode List
The NeetCode 150: an expansion of the Blind 75 into eighteen topic groups, from arrays and hashing through advanced graphs and two-dimensional dynamic programming.
- 150 problems
- 28 Easy
- 101 Medium
- 21 Hard
- 23 patterns
Where this list comes from
The NeetCode 150 is not ours. It is a published selection that people work through by name, and we reproduce it here by problem number, in the order the list itself uses. What we add is the solution: of the 150 entries below, 143 carry a complete Python solution with a worked example and its time and space complexity. The remaining 7 are either LeetCode Premium problems, whose statements are paywalled at the source, or problems our dataset holds no usable solution for. They are listed rather than quietly dropped, and the premium ones are marked in the tables.
The published list names 150 entries. All 150 resolve to a problem in this library and are listed below.
Every count on this page is computed from what the page renders, so the number in a heading is the number of rows under it. Nothing is padded to make a title's number come out right — that would be wrong in a way anyone who knows the list would spot in seconds.
All 150 problems, grouped by pattern
Each group is the pattern that most specifically solves those problems, so the list can be worked through a technique at a time instead of a problem at a time. Groups appear in the order the list itself introduces them.
Sorting (5)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 217 | Contains Duplicate | Easy | Array, Hash Table, Sorting |
| 242 | Valid Anagram | Easy | Hash Table, String, Sorting |
| 49 | Group Anagrams | Medium | Array, Hash Table, String +1 |
| 56 | Merge Intervals | Medium | Array, Sorting |
| 252 | Meeting RoomsPremium | Easy | Array, Sorting |
Hash Map (3)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 1 | Two Sum | Easy | Array, Hash Table |
| 271 | Encode and Decode StringsPremium | Medium | Design, Array, String |
| 2013 | Detect Squares | Medium | Design, Array, Hash Table +1 |
Heap / Priority Queue (10)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 347 | Top K Frequent Elements | Medium | Array, Hash Table, Divide and Conquer +5 |
| 703 | Kth Largest Element in a Stream | Easy | Tree, Design, Binary Search Tree +3 |
| 1046 | Last Stone Weight | Easy | Array, Heap (Priority Queue) |
| 973 | K Closest Points to Origin | Medium | Geometry, Array, Math +4 |
| 215 | Kth Largest Element in an Array | Medium | Array, Divide and Conquer, Quickselect +2 |
| 621 | Task Scheduler | Medium | Greedy, Array, Hash Table +3 |
| 295 | Find Median from Data Stream | Hard | Design, Two Pointers, Data Stream +2 |
| 743 | Network Delay Time | Medium | Depth-First Search, Breadth-First Search, Graph +2 |
| 787 | Cheapest Flights Within K Stops | Medium | Depth-First Search, Breadth-First Search, Graph +3 |
| 1851 | Minimum Interval to Include Each Query | Hard | Array, Binary Search, Sorting +2 |
Prefix Sum (2)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 238 | Product of Array Except Self | Medium | Array, Prefix Sum |
| 253 | Meeting Rooms IIPremium | Medium | Greedy, Array, Two Pointers +3 |
Matrix and Grid (8)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 36 | Valid Sudoku | Medium | Array, Hash Table, Matrix |
| 74 | Search a 2D Matrix | Medium | Array, Binary Search, Matrix |
| 417 | Pacific Atlantic Water Flow | Medium | Depth-First Search, Breadth-First Search, Array +1 |
| 994 | Rotting Oranges | Medium | Breadth-First Search, Array, Matrix |
| 286 | Walls and GatesPremium | Medium | Breadth-First Search, Array, Matrix |
| 48 | Rotate Image | Medium | Array, Math, Matrix |
| 54 | Spiral Matrix | Medium | Array, Matrix, Simulation |
| 73 | Set Matrix Zeroes | Medium | Array, Hash Table, Matrix |
Union-Find (9)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 128 | Longest Consecutive Sequence | Medium | Union Find, Array, Hash Table |
| 200 | Number of Islands | Medium | Depth-First Search, Breadth-First Search, Union Find +2 |
| 695 | Max Area of Island | Medium | Depth-First Search, Breadth-First Search, Union Find +2 |
| 130 | Surrounded Regions | Medium | Depth-First Search, Breadth-First Search, Union Find +2 |
| 684 | Redundant Connection | Medium | Depth-First Search, Breadth-First Search, Union Find +1 |
| 323 | Number of Connected Components in an Undirected GraphPremium | Medium | Depth-First Search, Breadth-First Search, Union Find +1 |
| 261 | Graph Valid TreePremium | Medium | Depth-First Search, Breadth-First Search, Union Find +1 |
| 1584 | Min Cost to Connect All Points | Medium | Union Find, Graph, Array +1 |
| 778 | Swim in Rising Water | Hard | Depth-First Search, Breadth-First Search, Union Find +4 |
Two Pointers (8)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 125 | Valid Palindrome | Easy | Two Pointers, String |
| 167 | Two Sum II - Input Array Is Sorted | Medium | Array, Two Pointers, Binary Search |
| 15 | 3Sum | Medium | Array, Two Pointers, Sorting |
| 11 | Container With Most Water | Medium | Greedy, Array, Two Pointers |
| 5 | Longest Palindromic Substring | Medium | Two Pointers, String, Dynamic Programming |
| 647 | Palindromic Substrings | Medium | Two Pointers, String, Dynamic Programming |
| 763 | Partition Labels | Medium | Greedy, Hash Table, Two Pointers +1 |
| 202 | Happy Number | Easy | Hash Table, Math, Two Pointers |
Stack (8)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 42 | Trapping Rain Water | Hard | Stack, Array, Two Pointers +2 |
| 20 | Valid Parentheses | Easy | Stack, String |
| 155 | Min Stack | Medium | Stack, Design |
| 150 | Evaluate Reverse Polish Notation | Medium | Stack, Array, Math |
| 739 | Daily Temperatures | Medium | Stack, Array, Monotonic Stack |
| 853 | Car Fleet | Medium | Stack, Array, Sorting +1 |
| 84 | Largest Rectangle in Histogram | Hard | Stack, Array, Monotonic Stack |
| 678 | Valid Parenthesis String | Medium | Stack, Greedy, String +1 |
Dynamic Programming (18)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 121 | Best Time to Buy and Sell Stock | Easy | Array, Dynamic Programming |
| 70 | Climbing Stairs | Easy | Memoization, Math, Dynamic Programming |
| 746 | Min Cost Climbing Stairs | Easy | Array, Dynamic Programming |
| 198 | House Robber | Medium | Array, Dynamic Programming |
| 213 | House Robber II | Medium | Array, Dynamic Programming |
| 91 | Decode Ways | Medium | String, Dynamic Programming |
| 152 | Maximum Product Subarray | Medium | Array, Dynamic Programming |
| 416 | Partition Equal Subset Sum | Medium | Array, Dynamic Programming |
| 62 | Unique Paths | Medium | Math, Dynamic Programming, Combinatorics |
| 1143 | Longest Common Subsequence | Medium | String, Dynamic Programming |
| 309 | Best Time to Buy and Sell Stock with Cooldown | Medium | Array, Dynamic Programming |
| 518 | Coin Change II | Medium | Array, Dynamic Programming |
| 97 | Interleaving String | Medium | String, Dynamic Programming |
| 115 | Distinct Subsequences | Hard | String, Dynamic Programming |
| 72 | Edit Distance | Medium | String, Dynamic Programming |
| 312 | Burst Balloons | Hard | Array, Dynamic Programming |
| 10 | Regular Expression Matching | Hard | Recursion, String, Dynamic Programming |
| 53 | Maximum Subarray | Medium | Array, Divide and Conquer, Dynamic Programming |
Sliding Window (5)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 3 | Longest Substring Without Repeating Characters | Medium | Hash Table, String, Sliding Window |
| 424 | Longest Repeating Character Replacement | Medium | Hash Table, String, Sliding Window |
| 567 | Permutation in String | Medium | Hash Table, Two Pointers, String +1 |
| 76 | Minimum Window Substring | Hard | Hash Table, String, Sliding Window |
| 239 | Sliding Window Maximum | Hard | Queue, Array, Sliding Window +2 |
Backtracking (11)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 22 | Generate Parentheses | Medium | String, Dynamic Programming, Backtracking |
| 78 | Subsets | Medium | Bit Manipulation, Array, Backtracking |
| 39 | Combination Sum | Medium | Array, Backtracking |
| 46 | Permutations | Medium | Array, Backtracking |
| 90 | Subsets II | Medium | Bit Manipulation, Array, Backtracking |
| 40 | Combination Sum II | Medium | Array, Backtracking |
| 79 | Word Search | Medium | Depth-First Search, Array, String +2 |
| 131 | Palindrome Partitioning | Medium | String, Dynamic Programming, Backtracking |
| 17 | Letter Combinations of a Phone Number | Medium | Hash Table, String, Backtracking |
| 51 | N-Queens | Hard | Array, Backtracking |
| 494 | Target Sum | Medium | Array, Dynamic Programming, Backtracking |
Monotonic Stack (6)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 704 | Binary Search | Easy | Array, Binary Search |
| 875 | Koko Eating Bananas | Medium | Array, Binary Search |
| 153 | Find Minimum in Rotated Sorted Array | Medium | Array, Binary Search |
| 33 | Search in Rotated Sorted Array | Medium | Array, Binary Search |
| 4 | Median of Two Sorted Arrays | Hard | Array, Binary Search, Divide and Conquer |
| 300 | Longest Increasing Subsequence | Medium | Array, Binary Search, Dynamic Programming |
Binary Search (1)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 981 | Time Based Key-Value Store | Medium | Design, Hash Table, String +1 |
Linked List (11)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 206 | Reverse Linked List | Easy | Recursion, Linked List |
| 21 | Merge Two Sorted Lists | Easy | Recursion, Linked List |
| 143 | Reorder List | Medium | Stack, Recursion, Linked List +1 |
| 19 | Remove Nth Node From End of List | Medium | Linked List, Two Pointers |
| 138 | Copy List with Random Pointer | Medium | Hash Table, Linked List |
| 2 | Add Two Numbers | Medium | Recursion, Linked List, Math |
| 141 | Linked List Cycle | Easy | Hash Table, Linked List, Two Pointers |
| 146 | LRU Cache | Medium | Design, Hash Table, Linked List +1 |
| 23 | Merge k Sorted Lists | Hard | Linked List, Divide and Conquer, Heap (Priority Queue) +1 |
| 25 | Reverse Nodes in k-Group | Hard | Recursion, Linked List |
| 355 | Design Twitter | Medium | Design, Hash Table, Linked List +1 |
Bit Manipulation (7)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 287 | Find the Duplicate Number | Medium | Bit Manipulation, Array, Two Pointers +1 |
| 136 | Single Number | Easy | Bit Manipulation, Array |
| 191 | Number of 1 Bits | Easy | Bit Manipulation, Divide and Conquer |
| 338 | Counting Bits | Easy | Bit Manipulation, Dynamic Programming |
| 190 | Reverse Bits | Easy | Bit Manipulation, Divide and Conquer |
| 268 | Missing Number | Easy | Bit Manipulation, Array, Hash Table +3 |
| 371 | Sum of Two Integers | Medium | Bit Manipulation, Math |
Tree Traversal (15)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 226 | Invert Binary Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 104 | Maximum Depth of Binary Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 543 | Diameter of Binary Tree | Easy | Tree, Depth-First Search, Binary Tree |
| 110 | Balanced Binary Tree | Easy | Tree, Depth-First Search, Binary Tree |
| 100 | Same Tree | Easy | Tree, Depth-First Search, Breadth-First Search +1 |
| 572 | Subtree of Another Tree | Easy | Tree, Depth-First Search, Binary Tree +2 |
| 235 | Lowest Common Ancestor of a Binary Search Tree | Medium | Tree, Depth-First Search, Binary Search Tree +1 |
| 102 | Binary Tree Level Order Traversal | Medium | Tree, Breadth-First Search, Binary Tree |
| 199 | Binary Tree Right Side View | Medium | Tree, Depth-First Search, Breadth-First Search +1 |
| 1448 | Count Good Nodes in Binary Tree | Medium | Tree, Depth-First Search, Breadth-First Search +1 |
| 98 | Validate Binary Search Tree | Medium | Tree, Depth-First Search, Binary Search Tree +1 |
| 230 | Kth Smallest Element in a BST | Medium | Tree, Depth-First Search, Binary Search Tree +1 |
| 105 | Construct Binary Tree from Preorder and Inorder Traversal | Medium | Tree, Array, Hash Table +2 |
| 124 | Binary Tree Maximum Path Sum | Hard | Tree, Depth-First Search, Dynamic Programming +1 |
| 297 | Serialize and Deserialize Binary Tree | Hard | Tree, Depth-First Search, Breadth-First Search +3 |
Trie (4)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 208 | Implement Trie (Prefix Tree) | Medium | Design, Trie, Hash Table +1 |
| 211 | Design Add and Search Words Data Structure | Medium | Depth-First Search, Design, Trie +1 |
| 212 | Word Search II | Hard | Trie, Array, String +2 |
| 139 | Word Break | Medium | Trie, Memoization, Array +3 |
Breadth-First Search (3)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 133 | Clone Graph | Medium | Depth-First Search, Breadth-First Search, Graph +1 |
| 127 | Word Ladder | Hard | Breadth-First Search, Hash Table, String |
| 322 | Coin Change | Medium | Breadth-First Search, Array, Dynamic Programming |
Topological Sort (4)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 207 | Course Schedule | Medium | Depth-First Search, Breadth-First Search, Graph +1 |
| 210 | Course Schedule II | Medium | Depth-First Search, Breadth-First Search, Graph +1 |
| 269 | Alien DictionaryPremium | Hard | Depth-First Search, Breadth-First Search, Graph +3 |
| 329 | Longest Increasing Path in a Matrix | Hard | Depth-First Search, Breadth-First Search, Graph +5 |
Depth-First Search (1)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 332 | Reconstruct Itinerary | Hard | Depth-First Search, Graph, Eulerian Circuit |
Greedy (6)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 55 | Jump Game | Medium | Greedy, Array, Dynamic Programming |
| 45 | Jump Game II | Medium | Greedy, Array, Dynamic Programming |
| 846 | Hand of Straights | Medium | Greedy, Array, Hash Table +1 |
| 1899 | Merge Triplets to Form Target Triplet | Medium | Greedy, Array |
| 134 | Gas Station | Medium | Greedy, Array |
| 435 | Non-overlapping Intervals | Medium | Greedy, Array, Dynamic Programming +1 |
Other (1)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 57 | Insert Interval | Medium | Array |
Math and Number Theory (4)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 66 | Plus One | Easy | Array, Math |
| 50 | Pow(x, n) | Medium | Recursion, Math |
| 43 | Multiply Strings | Medium | Math, String, Simulation |
| 7 | Reverse Integer | Medium | Math |
Other study lists
Or go by technique instead of by list: all LeetCode patterns · the full problem list.
The NeetCode 150 does not cover the problem you get asked
Stealth Interview is a desktop app for macOS and Windows. It reads the coding problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer is saying — while staying invisible to screen sharing.