Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 41s1 days 16 hours 1 minutes 41 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 41s1 days 16 hours 1 minutes 41 seconds.

Sign in to watch this lesson
Advanced - Arrays, Sorting and Searching · 4:48
Coordinate compression turns values as large as 10^18 into array indices without losing their order: sort, unique plus erase, then lower_bound. The MEX, the smallest missing non-negative integer, never exceeds n, so n + 1 flags compute it once and a set of missing numbers keeps it under updates. We also measure why clearing only what you touched beats a memset per test.