← Pointer Manipulation

Micro-Drill #85 — Same-direction pointers

Pointer Manipulation Target: 10s

Same-direction (slow/fast) pointers power sliding window and linked list cycle detection.

slow, fast = 0, 0
while fast < len(a):
    # expand fast, conditionally advance slow
    fast += 1

Type it from memory. Go.

Practice Problems

← Micro #84 Micro #86 →