Divide and Conquer LeetCode Problems: All 47,
With Python Solutions
Every problem in this library that LeetCode tags Divide and Conquer. 41 of them carry a complete Python solution, a worked example and the time and space complexity of the approach.
- Easy
- 5
- Medium
- 26
- Hard
- 16
Divide and Conquer problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Easy (5)
| No. | Problem | Topics |
|---|---|---|
| 0108 | Convert Sorted Array to Binary Search Tree | |
| 0169 | Majority Element | |
| 0190 | Reverse Bits | |
| 0191 | Number of 1 Bits | |
| 1763 | Longest Nice Substring |
Medium (26)
Hard (16)
| No. | Problem | Topics |
|---|---|---|
| 0004 | Median of Two Sorted Arrays | |
| 0023 | Merge k Sorted Lists | |
| 0218 | The Skyline Problem | |
| 0315 | Count of Smaller Numbers After Self | |
| 0327 | Count of Range Sum | |
| 0493 | Reverse Pairs | |
| 1569 | Number of Ways to Reorder Array to Get Same BST | |
| 1649 | Create Sorted Array through Instructions | |
| 1982 | Find Array Given Subset Sums | |
| 2179 | Count Good Triplets in an Array | |
| 2407 | Longest Increasing Subsequence II | |
| 2426 | Number of Pairs Satisfying Inequality | |
| 1274 | Number of Ships in a RectanglePremium | |
| 2519 | Count the Number of K-Big IndicesPremium | |
| 2613 | Beautiful PairsPremium | |
| 2792 | Count Nodes That Are Great EnoughPremium |
Eyes only
When the Divide and Conquer 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