Merge Sort LeetCode Problems: All 11, With Python Solutions
Every problem in this library that LeetCode tags Merge Sort — 11 in total, 9 of them with a complete Python solution, a worked example and the time and space complexity of the approach.
- 11 problems
- 0 Easy
- 3 Medium
- 8 Hard
How Merge Sort problems are solved
A tag names the subject, not the method. These pattern hubs cover the techniques that actually solve Merge Sort problems — each one explains the approach, gives a Python template and states its complexity.
- Sorting — Spend O(n log n) once to buy an ordering that makes the rest of the problem trivial.
Merge Sort problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Medium (3)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 148 | Sort List | Medium | Linked List, Two Pointers, Divide and Conquer +2 |
| 912 | Sort an Array | Medium | Array, Divide and Conquer, Bucket Sort +5 |
| 2031 | Count Subarrays With More Ones Than ZerosPremium | Medium | Binary Indexed Tree, Segment Tree, Array +5 |
Hard (8)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 23 | Merge k Sorted Lists | Hard | Linked List, Divide and Conquer, Heap (Priority Queue) +1 |
| 315 | Count of Smaller Numbers After Self | Hard | Binary Indexed Tree, Segment Tree, Array +4 |
| 327 | Count of Range Sum | Hard | Binary Indexed Tree, Segment Tree, Array +4 |
| 493 | Reverse Pairs | Hard | Binary Indexed Tree, Segment Tree, Array +4 |
| 1649 | Create Sorted Array through Instructions | Hard | Binary Indexed Tree, Segment Tree, Array +4 |
| 2179 | Count Good Triplets in an Array | Hard | Binary Indexed Tree, Segment Tree, Array +4 |
| 2426 | Number of Pairs Satisfying Inequality | Hard | Binary Indexed Tree, Segment Tree, Array +4 |
| 2519 | Count the Number of K-Big IndicesPremium | Hard | Binary Indexed Tree, Segment Tree, Array +4 |
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 Merge Sort 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.