LeetCode topics — String

Data Structure

Len Chen
2 min readFeb 4, 2020

Questions

basic

substring

palindrome

parentheses

Solutions

basic

KMP Algorithm
Three Pointers
Two Pointers and Reverse
HashSet
Simulation
Dynamic Programming
HashSet
HashMap
Couting as Hash Key
Sliding Window with Counting
Distance as Hash Key
Two Pointers
Simulation
Stack
Two Pointers
Chunk Length
Modulo
Simulation
Simulation
Ad hoc
Ad hoc
Simulation
Simulation
Simulation
Simulation
Simulation
Next Permutation
Find Splitting Character
Dynamic Programming
Find Splitting Character
HashMap
Dynamic Programming
Work Backwards
Greedy

substring

Sliding Window with Two Pointers and Counts
Sliding Window with Two Pointers and HashMap
Sliding Window for All Possible Character Counts
Ordered Dict
KMP
Ad hoc
Top-Down DP with KMP
Bitwise Operation
Find Unmatching as Anchor

palindrome

Two Pointers
Two Pointers
Expand Around Center by Two Pointers
KMP Algorithm
Trie
HashMap

parentheses

Stack
Trace Range of Opened Parenthesis
Dynamic Programming
Two Pointers
Divide and Conquer
BFS

--

--