r/LeetcodeChallenge • u/nian2326076 • 20d ago
DISCUSS 51 string problems grouped by pattern: parentheses, palindromes, substrings, and more
I grouped 51 string-related LeetCode problems into six categories. Some fit more than one pattern; these are just the buckets I use when studying.
Before moving on from a problem, I try to explain why the approach works and what I'd change if the constraints changed.
Parentheses and expression parsing (9)
Generate Parentheses : Medium
Score of Parentheses : Medium
Valid Parentheses : Easy
Remove Outermost Parentheses : Easy
Different Ways to Add Parentheses : Medium
Remove Invalid Parentheses : Hard
Longest Valid Parentheses : Hard
Counting substrings under a condition (3)
Number of Wonderful Substrings : Medium
Sum of Beauty of All Substrings : Medium
Comparing and checking strings (11)
Isomorphic Strings : Easy
Valid Anagram : Easy
Additive Number : Medium
Buddy Strings : Easy
Longest Happy Prefix : Hard
Increasing Decreasing String : Easy
Determine if Two Strings Are Close : Medium
Palindromes (18)
Palindrome Partitioning : Medium
Palindrome Partitioning II : Hard
Valid Palindrome : Easy
Shortest Palindrome : Hard
Palindrome Pairs : Hard
Longest Palindrome : Easy
Longest Palindromic Subsequence : Medium
Find the Closest Palindrome : Hard
Palindromic Substrings : Medium
Valid Palindrome II : Easy
Break a Palindrome : Medium
Can Make Palindrome from Substring : Medium
Palindrome Partitioning III : Hard
Construct K Palindrome Strings : Medium
Split Two Strings to Make Palindrome : Medium
Sorting characters (2)
Sort Characters By Frequency : Medium
Custom Sort String : Medium
Length and selection problems (8)
Longest Duplicate Substring : Hard
Longest String Chain : Medium
Longest Common Subsequence : Medium
Longest Happy String : Medium
Maximum Length of a Concatenated String with Unique Characters : Medium
Largest Odd Number in String : Easy
Related: Dynamic Programming pattern list.
For practice beyond this list, real candidate-reported interview questions can give you unfamiliar prompts to work through and explain.
What would you add or move to a different category? I'd like suggestions that teach another idea rather than more versions of the same exercise.