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)

Easy problems
No.Problem
0108Convert Sorted Array to Binary Search Tree
0169Majority Element
0190Reverse Bits
0191Number of 1 Bits
1763Longest Nice Substring

Medium (26)

Medium problems
No.Problem
0053Maximum Subarray
0105Construct Binary Tree from Preorder and Inorder Traversal
0106Construct Binary Tree from Inorder and Postorder Traversal
0109Convert Sorted List to Binary Search Tree
0148Sort List
0215Kth Largest Element in an Array
0240Search a 2D Matrix II
0307Range Sum Query - Mutable
0324Wiggle Sort II
0347Top K Frequent Elements
0372Super Pow
0395Longest Substring with At Least K Repeating Characters
0427Construct Quad Tree
0558Logical OR of Two Binary Grids Represented as Quad-Trees
0654Maximum Binary Tree
0889Construct Binary Tree from Preorder and Postorder Traversal
0912Sort an Array
0918Maximum Sum Circular Subarray
0932Beautiful Array
0973K Closest Points to Origin
1382Balance a Binary Search Tree
1738Find Kth Largest XOR Coordinate Value
1985Find the Kth Largest Integer in the Array
2343Query Kth Smallest Trimmed Number
1756Design Most Recently Used QueuePremium
2031Count Subarrays With More Ones Than ZerosPremium

Hard (16)

Hard problems
No.Problem
0004Median of Two Sorted Arrays
0023Merge k Sorted Lists
0218The Skyline Problem
0315Count of Smaller Numbers After Self
0327Count of Range Sum
0493Reverse Pairs
1569Number of Ways to Reorder Array to Get Same BST
1649Create Sorted Array through Instructions
1982Find Array Given Subset Sums
2179Count Good Triplets in an Array
2407Longest Increasing Subsequence II
2426Number of Pairs Satisfying Inequality
1274Number of Ships in a RectanglePremium
2519Count the Number of K-Big IndicesPremium
2613Beautiful PairsPremium
2792Count 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.