← Two Pointers

Pattern Recognition Drill

#13 — Find cycle start

Medium Linked Lists

The Problem

Find the node where the cycle begins in a linked list.

What approach would you use?

Think about it before scrolling down.

Key Signals

Two Pointers

After detection: reset slow to head, advance both by 1. They meet at cycle start. O(n).

Alt: Hash Map

Store each visited node; first repeat is cycle start. O(n) space.

Common Trap

This is a two-phase algorithm: detect first, then find start. Don't try to do both in one pass.

← #12 #14 →