Index

Module 08 · DSAWorked problems, in English

Clinic #32: Single Number

Thinking in Bits
Thinking in Bits · Open board

The five moves a processor can make on a number’s row of switches. This clinic uses one of them, XOR, the move that flips a switch only where two rows disagree, and shows why it is the whole answer to one of the most asked easy problems.

Before you start. A computer stores every whole number as a row of ones and zeros, a row of switches read in twos instead of tens, so 101 is one four and one one, five. Bit Manipulation (thinking in bits) shows that row and the moves on it; this clinic needs only the row itself, and builds the one move it uses from scratch.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Review DSA →

Saved in this browser, and to your account when you sign in.