WORLD 7

GREEDY

Take the best move right now and never look back, when you can prove that's safe: jumps, a road trip, a packed stage.

STAGE 0 Greedy tutorial

0:00 / 0:00

The move

Take what looks best right now and never go back. It only works when today's best pick can't hurt you later, so the skill is spotting when that's safe. Often you sort first, or track one value such as the farthest reach.

Spot it
Minimum number of, maximum you can, intervals, or can you reach, where swapping in the greedy pick never makes things worse.
Cost
Usually one pass: O(n) time, or O(n log n) with a sort.

16 STAGES Greedy problems

☆☆☆☆☆ Clear 5 to finish this world.