LeetCode Problems List: All 3,000,
Organised by Pattern
This library holds a page for every problem on LeetCode, and most of them carry a complete Python solution: a worked example, a step-by-step explanation and the time and space complexity of the approach. The problems are LeetCode's; the solutions, the grouping and the explanations are ours.
- With a full solution
- 2,690
- Patterns
- 22
- Topics
- 60
Browse by pattern
A pattern is the shape of the solution, and it transfers: once the sliding window is in your hands, every problem about a contiguous subarray becomes the same problem with different bookkeeping.
Problem numbers are a poor way to study, because the number tells you nothing about how the problem is solved. Each hub below explains the technique, gives a Python template you can adapt, states the complexity and lists every problem in the library it applies to, in the order to learn them; the pattern index adds each one's summary and difficulty split.
- Hash Map709
- Two Pointers201
- Sliding Window116
- Prefix Sum157
- Stack194
- Monotonic Stack225
- Sorting401
- Binary Search254
- Linked List75
- Tree Traversal225
- Depth-First Search366
- Breadth-First Search233
- Matrix and Grid216
- Heap / Priority Queue163
- Greedy346
- Backtracking105
- Dynamic Programming481
- Math and Number Theory485
- Union-Find83
- Topological Sort32
- Trie49
- Bit Manipulation194
Eyes only
Stuck on the one they actually ask?
In the live round, Stealth Interview reads the 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 says. It's a desktop app for macOS and Windows, invisible to screen sharing.
Curated study lists
Five well-known selections, none of them ours. We reproduce each list by problem number, say how many of its entries are in this library and how many of those carry a full solution, and link every one to its page here. The study-list index sets the five side by side.
Browse by difficulty
Difficulty is LeetCode's own rating, carried through unchanged. Each band has a page that lists every problem in it, the ones with a complete solution first.
Browse by topic
LeetCode's own tags, which are coarser than the patterns above but are what the problem set is officially classified by. The 30 largest are below; every tag with at least eight problems has a page, and the topic index lists them all.
- Array1,569
- String672
- Hash Table588
- Math485
- Dynamic Programming481
- Sorting392
- Greedy346
- Depth-First Search289
- Binary Search253
- Database249
- Tree225
- Breadth-First Search223
- Matrix216
- Two Pointers201
- Bit Manipulation194
- Binary Tree174
- Heap (Priority Queue)163
- Prefix Sum157
- Stack157
- Simulation144
- Graph138
- Counting126
- Design122
- Sliding Window116
- Backtracking105
- Union Find83
- Enumeration80
- Linked List75
- JavaScript67
- Monotonic Stack58