LEETCODE
Solutions, written up.
279 problems I have solved, most of them from the daily challenge. Each page explains the idea behind the solution, gives its complexity, and has the code (mostly Python and Java) that I tested before submitting. The source is on GitHub.
- 2911Minimum Changes to Make K Semi-palindromesTwo Pointers · String · Dynamic Programminghard
- 2243Calculate Digit Sum of a StringString · Simulationeasy
- 1524Number of Sub-arrays With Odd SumArray · Math · Dynamic Programming · Prefix Summedium
- 273Integer to English WordsMath · String · Recursionhard
- 3364Minimum Positive Sum SubarrayArray · Sliding Window · Prefix Sumeasy
- 3420Count Non-Decreasing Subarrays After K OperationsArray · Stack · Segment Tree · Sliding Window · Monotonic Stackhard
- 3105Longest Strictly Increasing or Strictly Decreasing SubarrayArrayeasy
- 262Trips and UsersDatabasehard
- 3789Minimum Cost to Acquire Required ItemsMath · Greedymedium
- 3693Climbing Stairs IIArray · Dynamic Programmingmedium
- 1606Find Servers That Handled Most Number of RequestsArray · Heap (Priority Queue) · Simulationhard
- 1267Count Servers that CommunicateArray · Depth-First Search · Breadth-First Search · Matrix · Countingmedium
- 1882Process Tasks Using ServersArray · Heap (Priority Queue)medium
- 2747Count Zero Request ServersArray · Hash Table · Sliding Window · Sortingmedium
- 1385Find the Distance Value Between Two ArraysArray · Two Pointers · Binary Search · Sortingeasy
- 239Sliding Window MaximumArray · Sliding Window · Heap (Priority Queue)hard
- 3505Minimum Operations to Make Elements Within K Subarrays EqualArray · Hash Table · Math · Dynamic Programming · Sliding Window · Heap (Priority Queue)hard
- 3736Minimum Moves to Equal Array Elements IIIArray · Matheasy
- 233Number of Digit OneMath · Dynamic Programming · Recursionhard
- 462Minimum Moves to Equal Array Elements IIArray · Math · Sortingmedium
- 453Minimum Moves to Equal Array ElementsArray · Mathmedium
- 3665Twisted Mirror Path CountArray · Dynamic Programming · Matrixmedium
- 3970Shortest Path With At Most K Consecutive Identical CharactersGraph · String · Heap (Priority Queue) · Shortest Pathmedium
- 3841Palindromic Path Queries in a TreeArray · String · Divide and Conquer · Bit Manipulation · Tree · Depth-First Search · Binary Indexed Tree · Segment Treehard
- 3882Minimum XOR Path in a GridArray · Dynamic Programming · Bit Manipulation · Matrixmedium