Strings mind map

Character arrays, parsing, and string algorithms.

Core idea: Choose the unit—character, token, or prefix—then treat text as a structured sequence.

Mnemonic: Normalize → bound → parse · Cost: O(n) scan · alphabet state

Normalize: Canonical comparison

Signal: Formatting differs, but identity should not.

Move: Fold case and spacing, or compare a frequency signature instead of raw text.

Examples: Valid Palindrome, Valid Anagram, Group Anagrams

Cover: Character window

Signal: A longest or shortest valid substring must stay contiguous.

Move: Grow counts, then shrink from the left while the constraint still holds.

Examples: Minimum Window Substring, Longest Unique Substring, Find Anagrams

Parse: Stack & state machine

Signal: Nested syntax, operators, escapes, or unfinished frames.

Move: Let each token update explicit state; push context that must resume later.

Examples: Decode String, Basic Calculator, Simplify Path

Segment: Prefix choices

Signal: The string must be split into legal words or palindromes.

Move: Choose a valid prefix, then solve or memoize the remaining suffix.

Examples: Word Break, Palindrome Partitioning, Text Justification

Every mind map