method
Divide and Conquer — animated LeetCode walkthroughs
LeetCode problems solved with Divide and Conquer. Browse the complete tag, then watch the algorithm move — step-by-step animation, Python and Go.
71 problems · 62 animated · 9 locked
Full D&C index
- 4Median of Two Sorted ArraysWatch
- 23Merge k Sorted ListsWatch
- 53Maximum SubarrayWatch
- 105Construct Binary Tree from Preorder and Inorder TraversalWatch
- 106Construct Binary Tree from Inorder and Postorder TraversalWatch
- 108Convert Sorted Array to Binary Search TreeWatch
- 109Convert Sorted List to Binary Search TreeWatch
- 148Sort ListWatch
- 169Majority ElementWatch
- 190Reverse BitsWatch
- 191Number of 1 BitsWatch
- 215Kth Largest Element in an ArrayWatch
- 218The Skyline ProblemWatch
- 240Search a 2D Matrix IIWatch
- 307Range Sum Query - MutableWatch
- 315Count of Smaller Numbers After SelfWatch
- 324Wiggle Sort IIWatch
- 327Count of Range SumWatch
- 347Top K Frequent ElementsWatch
- 372Super PowWatch
- 395Longest Substring with At Least K Repeating CharactersWatch
- 427Construct Quad TreeWatch
- 493Reverse PairsWatch
- 558Logical OR of Two Binary Grids Represented as Quad-TreesWatch
- 654Maximum Binary TreeWatch
- 761Special Binary StringWatch
- 889Construct Binary Tree from Preorder and Postorder TraversalWatch
- 912Sort an ArrayWatch
- 918Maximum Sum Circular SubarrayWatch
- 932Beautiful ArrayWatch
- 973K Closest Points to OriginWatch
- 1274Number of Ships in a RectangleLocked
- 1382Balance a Binary Search TreeWatch
- 1569Number of Ways to Reorder Array to Get Same BSTWatch
- 1649Create Sorted Array through InstructionsWatch
- 1738Find Kth Largest XOR Coordinate ValueWatch
- 1756Design Most Recently Used QueueLocked
- 1763Longest Nice SubstringWatch
- 1985Find the Kth Largest Integer in the ArrayWatch
- 2031Count Subarrays With More Ones Than ZerosLocked
- 2179Count Good Triplets in an ArrayWatch
- 2343Query Kth Smallest Trimmed NumberWatch
- 2407Longest Increasing Subsequence IIWatch
- 2426Number of Pairs Satisfying InequalityWatch
- 2519Count the Number of K-Big IndicesLocked
- 2613Beautiful PairsLocked
- 2792Count Nodes That Are Great EnoughLocked
- 3109Find the Index of PermutationLocked
- 3165Maximum Sum of Subsequence With Non-adjacent ElementsWatch
- 3410Maximize Subarray Sum After Removing All Occurrences of One ElementWatch
- 3520Minimum Threshold for Inversion Pairs CountLocked
- 3537Fill a Special GridWatch
- 3624Number of Integers With Popcount-Depth Equal to K IIWatch
- 3636Threshold Majority QueriesWatch
- 3653XOR After Range Multiplication Queries IWatch
- 3655XOR After Range Multiplication Queries IIWatch
- 3719Longest Balanced Subarray IWatch
- 3721Longest Balanced Subarray IIWatch
- 3737Count Subarrays With Majority Element IWatch
- 3739Count Subarrays With Majority Element IIWatch
- 3749Evaluate Valid ExpressionsLocked
- 3759Count Elements With at Least K Greater ValuesWatch
- 3826Minimum Partition ScoreWatch
- 3841Palindromic Path Queries in a TreeWatch
- 3855Sum of K-Digit Numbers in a RangeWatch
- 3864Minimum Cost to Partition a Binary StringWatch
- 3943Number of Pairs After IncrementWatch
- 4011Count Subarrays With Even Odd Ratio IWatch
- 4013Count Subarrays With Even Odd Ratio IIWatch
- 4017Peaks in Array IIWatch
- 4055Count Shadow Pairs IIWatch