字符串
Data Structures & Algorithms · 25 notes
- Longest Substring Without Repeating Charactershistorical
LeetCode notes on the longest substring without repeating characters.
- Longest Common Subsequencehistorical
Longest common subsequence using recursion, DFS with memoization, and dynamic programming.
- Letter Combinations of a Phone Numberhistorical
Letter combinations of a phone number using DFS to enumerate combinations.
- Find All Anagrams in a Stringhistorical
Find all anagrams in a string using brute force and a sliding window with counts.
- Longest Common Prefixhistorical
Longest common prefix using a brute-force approach, with a trie idea noted.
- Palindromic Substringshistorical
Count palindromic substrings using brute force and center expansion.
- Longest Palindromic Substringhistorical
Longest palindromic substring using brute force and center expansion.
- Big Number Additionhistorical
Add large numbers represented as strings by scanning from right to left and carrying.
- Longest Valid Parentheseshistorical
Use a stack to mark matched parentheses, then count the longest consecutive valid interval.
- Remove Invalid Parentheseshistorical
Enumerate whether to keep or remove each character, then keep the longest valid-parentheses results.
- Generate Parentheseshistorical
Generate parentheses using full enumeration with a stack, and pruning based on remaining left/right parentheses.
- Valid Parentheseshistorical
Validate a parentheses sequence using a stack or repeated string replacement.
- Longest Substring Without Repeating Charactershistorical
Find the longest substring without repetition using a brute-force set approach and a sliding window.