Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Find the Duplicate Number

MediumLeetCode 287 ↗

The problem, in one line. An array of n + 1 numbers holds values from 1 to n, so at least one value repeats. Find a repeated value without changing the array and with constant extra space. LeetCode 287.

The tell. Every value is a valid index, and the limits forbid a set and forbid sorting in place. When each value points at a position, the array is a linked list in disguise.

Included with a plan

This solution is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.