↓Skip to main content

String

LeetCode 30: Substring with Concatenation of All Words (Brute Force → Counting → Sliding Window)
·3 mins
LeetCode Daily Hard String Sliding-Window Two-Pointers Hash-Map Brute-Force Frequency-Counting
Three approaches: brute force, counting optimization, and sliding window over word-length offsets.
LeetCode 1071: Greatest Common Divisor of Strings
·2 mins
LeetCode Daily Easy String Gcd Math
LeetCode Problem Solving
LeetCode 76: Minimum Window Substring
·3 mins
LeetCode Daily Hard String Sliding-Window Variable-Window Two-Pointers Hash-Map
LeetCode Problem Solving - Variable Size Sliding Window with Character Counting
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 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 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
LeetCode 2391: Minimum Amount of Time to Collect Garbage
·2 mins
LeetCode Medium Prefix-Sum String Array
LeetCode 2391 note: pickup time is the total garbage count; each truck only drives to the last house with its type, using a prefix sum of travel
LeetCode 1410: HTML Entity Parser
·2 mins
LeetCode Medium Hash-Table String
LeetCode 1410 note: scan left to right, trying all six entities at each position and skipping past a match; chained replace does not work
LeetCode 3612: Process String with Special Operations I
·2 mins
LeetCode Medium String Simulation
LeetCode 3612 note: simulate the four operations with a list; put the “result is non-empty” check inside the * branch, or * gets appended as a letter
LeetCode 3606: Coupon Code Validator
·2 mins
LeetCode Easy Hash-Table String Sorting
LeetCode 3606 note: filter valid coupons, then sort by (category order, code); character ranges must include z, Z and 9
LeetCode 3545: Minimum Deletions for At Most K Distinct Characters
·1 min
LeetCode Easy Greedy Hash-Table String Sorting Counting
LeetCode 3545 note: reducing the number of kinds means deleting whole kinds, starting from the least frequent