Topic 3
Strings
Scan, compare and rebuild text efficiently.
Strings are sequences of characters, immutable in Python, Java, JavaScript and Go. Repeated concatenation in a loop can be quadratic, so collect pieces in a list or builder. Most problems are a single pass with index or counter bookkeeping.
Key patterns
- Single pass with a counter
- Two indices from both ends
- Frequency array of 26 letters
- Build with a builder, not repeated +=
Problems
0 / 47 solved