Memoization LeetCode Problems: All 39, With Python Solutions
Every problem in this library that LeetCode tags Memoization — 39 in total, 38 of them with a complete Python solution, a worked example and the time and space complexity of the approach.
- 39 problems
- 3 Easy
- 11 Medium
- 25 Hard
How Memoization problems are solved
A tag names the subject, not the method. These pattern hubs cover the techniques that actually solve Memoization problems — each one explains the approach, gives a Python template and states its complexity.
- Dynamic Programming — Define a state, write the transition, and stop recomputing the same subproblem.
Memoization problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Easy (3)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 70 | Climbing Stairs | Easy | Memoization, Math, Dynamic Programming |
| 509 | Fibonacci Number | Easy | Recursion, Memoization, Math +1 |
| 1137 | N-th Tribonacci Number | Easy | Memoization, Math, Dynamic Programming |
Medium (11)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 139 | Word Break | Medium | Trie, Memoization, Array +3 |
| 241 | Different Ways to Add Parentheses | Medium | Recursion, Memoization, Math +2 |
| 397 | Integer Replacement | Medium | Greedy, Bit Manipulation, Memoization +1 |
| 464 | Can I Win | Medium | Bit Manipulation, Memoization, Math +3 |
| 638 | Shopping Offers | Medium | Bit Manipulation, Memoization, Array +3 |
| 698 | Partition to K Equal Sum Subsets | Medium | Bit Manipulation, Memoization, Array +3 |
| 894 | All Possible Full Binary Trees | Medium | Tree, Recursion, Memoization +2 |
| 1387 | Sort Integers by The Power Value | Medium | Memoization, Dynamic Programming, Sorting |
| 2311 | Longest Binary Subsequence Less Than or Equal to K | Medium | Greedy, Memoization, String +1 |
| 2998 | Minimum Number of Operations to Make X and Y Equal | Medium | Breadth-First Search, Memoization, Dynamic Programming |
| 294 | Flip Game IIPremium | Medium | Memoization, Math, Dynamic Programming +2 |
Hard (25)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 140 | Word Break II | Hard | Trie, Memoization, Array +4 |
| 329 | Longest Increasing Path in a Matrix | Hard | Depth-First Search, Breadth-First Search, Graph +5 |
| 488 | Zuma Game | Hard | Stack, Breadth-First Search, Memoization +2 |
| 546 | Remove Boxes | Hard | Memoization, Array, Dynamic Programming |
| 691 | Stickers to Spell Word | Hard | Bit Manipulation, Memoization, Array +5 |
| 773 | Sliding Puzzle | Hard | Breadth-First Search, Memoization, Array +3 |
| 913 | Cat and Mouse | Hard | Graph, Topological Sort, Memoization +3 |
| 964 | Least Operators to Express Number | Hard | Memoization, Math, Dynamic Programming |
| 1444 | Number of Ways of Cutting a Pizza | Hard | Memoization, Array, Dynamic Programming +2 |
| 1553 | Minimum Number of Days to Eat N Oranges | Hard | Memoization, Dynamic Programming |
| 1569 | Number of Ways to Reorder Array to Get Same BST | Hard | Tree, Union Find, Binary Search Tree +7 |
| 1575 | Count All Possible Routes | Hard | Memoization, Array, Dynamic Programming |
| 1611 | Minimum One Bit Operations to Make Integers Zero | Hard | Bit Manipulation, Memoization, Dynamic Programming |
| 1659 | Maximize Grid Happiness | Hard | Bit Manipulation, Memoization, Dynamic Programming +1 |
| 1728 | Cat and Mouse II | Hard | Graph, Topological Sort, Memoization +5 |
| 1815 | Maximum Number of Groups Getting Fresh Donuts | Hard | Bit Manipulation, Memoization, Array +2 |
| 1857 | Largest Color Value in a Directed Graph | Hard | Graph, Topological Sort, Memoization +3 |
| 1900 | The Earliest and Latest Rounds Where Players Compete | Hard | Memoization, Dynamic Programming |
| 2019 | The Score of Students Solving Math Expression | Hard | Stack, Memoization, Array +4 |
| 2312 | Selling Pieces of Wood | Hard | Memoization, Array, Dynamic Programming |
| 2318 | Number of Distinct Roll Sequences | Hard | Memoization, Dynamic Programming |
| 2328 | Number of Increasing Paths in a Grid | Hard | Depth-First Search, Breadth-First Search, Graph +5 |
| 2713 | Maximum Strictly Increasing Cells in a Matrix | Hard | Memoization, Array, Hash Table +5 |
| 2876 | Count Visited Nodes in a Directed Graph | Hard | Graph, Memoization, Dynamic Programming |
| 2920 | Maximum Points After Collecting Coins From All Nodes | Hard | Bit Manipulation, Tree, Depth-First Search +3 |
Keep exploring
- 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
When the Memoization problem arrives live
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.