See the whole chapter as one picture — the moves, the traps, which room sits where. No tokens spent.

Arrays mind map

Searching, two pointers, and array manipulation.

Core idea: Indices are state; exploit order, adjacency, and in-place writes.

Mnemonic: Scan → partition → write · Cost: O(1) access · O(n) sweep

Sweep: Running state & read/write

Signal: One pass can carry the best prefix or compact survivors.

Move: Read every value; update the summary or advance write only when it survives.

Examples: Maximum Subarray, Best Time to Buy Stock, Move Zeroes

Meet: Two pointers

Signal: Sorted input, opposing ends, or an in-place partition.

Move: Move the pointer whose side cannot improve without changing.

Examples: Two Sum II, Container With Most Water, Remove Duplicates

Accumulate: Prefix & suffix

Signal: Many range questions or “everything except here.”

Move: Store one direction once, then answer by difference or combine both sides.

Examples: Range Sum Query, Product Except Self, Pivot Index

Place: Index & cycle math

Signal: Values belong to a bounded index range or the array must rotate.

Move: Mark, swap, or preserve the displaced value until each item reaches its home.

Examples: First Missing Positive, Rotate Array, Next Permutation

Every mind map