Workspace Fast Slow Pointers
0d
Problem-solving patterns

Fast and Slow Pointers

Move references at different rates through one chain.

Recognition signal

Find a midpoint or detect repeated visits without a set.

Method

Advance slow once and fast twice while both fast hops are safe.

Worked example

After fast moves from A to C to E, slow has moved from A to B to C.

Common mistake

Comparing node values confuses repeated values with revisiting one node.