↓Skip to main content

LeetCode

LeetCode 135: Candy
·2 mins
LeetCode Hard Greedy Array
LeetCode 135 note: one pass left to right for the left neighbor, one right to left for the right neighbor, and give each child the larger of the two
LeetCode 3639: Minimum Time to Activate String
·3 mins
LeetCode Medium Binary-Search Counting String
LeetCode 3639 note: each new star adds (left distance) × (right distance) new substrings; or binary search on time
LeetCode 3638: Maximum Balanced Shipments
·2 mins
LeetCode Medium Dynamic-Programming Greedy Monotonic-Stack Array
LeetCode 3638 note: greedily cut a segment as soon as a value below its maximum appears; until then the segment is non-decreasing, so its maximum is the previous value
LeetCode 3637: Trionic Array I
·2 mins
LeetCode Easy Array
LeetCode 3637 note: walk one index through uphill, downhill and uphill; all three runs must be non-empty and reach the end exactly
LeetCode 1658: Minimum Operations to Reduce X to Zero
·3 mins
LeetCode Daily Medium Array Sliding-Window Prefix-Sum Reverse-Thinking
LeetCode Problem Solving - Reverse Thinking with Sliding Window
LeetCode 1456: Maximum Number of Vowels in a Substring of Given Length
·2 mins
LeetCode Daily Medium String Sliding-Window Fixed-Window Vowel-Counting
LeetCode Problem Solving - Fixed Size Sliding Window with Vowel Counting
LeetCode 1052: Grumpy Bookstore Owner
·3 mins
LeetCode Daily Medium Array Sliding-Window Fixed-Window Optimization
LeetCode Problem Solving - Fixed Window with Customer Satisfaction Optimization
LeetCode 1004: Max Consecutive Ones III
·3 mins
LeetCode Daily Medium Array Sliding-Window Two-Pointers Binary-Array
LeetCode Problem Solving - Variable Size Sliding Window with Zero Counting
LeetCode 713: Subarray Product Less Than K
·3 mins
LeetCode Daily Medium Sliding-Window
LeetCode Problem Solving
LeetCode 643: Maximum Average Subarray I
·1 min
LeetCode Daily Easy Sliding-Window
LeetCode Problem Solving
LeetCode 567: Permutation in String
·4 mins
LeetCode Daily Medium String Sliding-Window Hash-Map Frequency-Counting Permutation
LeetCode Problem Solving - Sliding Window with Character Frequency
LeetCode 438: Find All Anagrams in a String
·4 mins
LeetCode Daily Medium String Sliding-Window Hash-Map Anagram Frequency-Counting
LeetCode Problem Solving - Sliding Window with Character Frequency