Minimum Instructions to Reach a Target Position

Asked at Waymo · Coding Questions · Difficulty: Hard · Last asked Jul 6, 2026

A car drives along an infinite number line. It starts at position `0` with speed `+1` and obeys a sequence of instructions. Find the shortest instruction sequence that leaves the car exactly at a given target position.

Loading the problem…