Recursion LeetCode Problems: All 45,
With Python Solutions
Every problem in this library that LeetCode tags Recursion. 36 of them carry a complete Python solution, a worked example and the time and space complexity of the approach.
- Easy
- 9
- Medium
- 22
- Hard
- 14
Recursion problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Easy (9)
| No. | Problem | Topics |
|---|---|---|
| 0021 | Merge Two Sorted Lists | |
| 0203 | Remove Linked List Elements | |
| 0206 | Reverse Linked List | |
| 0231 | Power of Two | |
| 0234 | Palindrome Linked List | |
| 0326 | Power of Three | |
| 0342 | Power of Four | |
| 0509 | Fibonacci Number | |
| 2094 | Finding 3-Digit Even Numbers |
Medium (22)
| No. | Problem | Topics |
|---|---|---|
| 0002 | Add Two Numbers | |
| 0024 | Swap Nodes in Pairs | |
| 0050 | Pow(x, n) | |
| 0143 | Reorder List | |
| 0241 | Different Ways to Add Parentheses | |
| 0390 | Elimination Game | |
| 0394 | Decode String | |
| 0486 | Predict the Winner | |
| 0779 | K-th Symbol in Grammar | |
| 0894 | All Possible Full Binary Trees | |
| 1545 | Find Kth Bit in Nth Binary String | |
| 1823 | Find the Winner of the Circular Game | |
| 1922 | Count Good Numbers | |
| 1969 | Minimum Non-Zero Product of the Array Elements | |
| 2487 | Remove Nodes From Linked List | |
| 2550 | Count Collisions of Monkeys on a Polygon | |
| 0247 | Strobogrammatic Number IIPremium | |
| 0255 | Verify Preorder Sequence in Binary Search TreePremium | |
| 0439 | Ternary Expression ParserPremium | |
| 0544 | Output Contest MatchesPremium | |
| 0776 | Split BSTPremium | |
| 1265 | Print Immutable Linked List in ReversePremium |
Hard (14)
| No. | Problem | Topics |
|---|---|---|
| 0010 | Regular Expression Matching | |
| 0025 | Reverse Nodes in k-Group | |
| 0044 | Wildcard Matching | |
| 0060 | Permutation Sequence | |
| 0224 | Basic Calculator | |
| 0233 | Number of Digit One | |
| 0273 | Integer to English Words | |
| 0736 | Parse Lisp Expression | |
| 0761 | Special Binary String | |
| 1106 | Parsing A Boolean Expression | |
| 1808 | Maximize Number of Nice Divisors | |
| 0248 | Strobogrammatic Number IIIPremium | |
| 0770 | Basic Calculator IV | |
| 0772 | Basic Calculator IIIPremium |
Eyes only
When the Recursion problem arrives live.
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.
Keep exploring
Other topics
- 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