Read or replace array[i] without walking through earlier values.
Arrays & Two Pointers
7 chapters · 12 challenges · The Dune Sea
Understand the idea, practise through play, then prove it in code. Choose your next quest below.
Visual introduction to this topic
What is an array?
An array stores values in one ordered, contiguous sequence. Every position has an index, so you can jump directly to a known position or scan neighboring values in order.
Think of numbered lockers. A locker number takes you straight to its contents. Finding an unknown item still means opening lockers until you see it.
Indices give O(1) access; scanning the full row costs O(n).
Two pointers, windows, and prefixes exploit the fact that neighbors stay together.
Adding near the front may move every value that follows.
Index the dunes
Array Basics
0/2 completeIndex, scan, and mutate contiguous values.
Hashing
0/4 completeTrade memory for constant-time membership and lookup.
Prefix and Suffix
0/1 completeCombine directional summaries without rescanning or division.
Two Pointers
0/2 completeCoordinate sentinels across sorted and symmetric data.
Boundary Reasoning
0/1 completeMeasure capacity using moving boundaries.
Multi-Value Search
0/1 completeSort and control duplicate combinations.
Final challenge
0/1 completeCombine the skills from this world in a final challenge.
Built from authoritative material
This track is checked against the sources below. Visual traces still carry their own complete or guided coverage label, so unfinished explanations are not presented as complete executions.