Taking the best choice at every step and seeing why it is enough: change, jumps, meeting schedules and handing out.
Key ideas
- Take what looks best right now, but be able to argue why that is enough.
- With intervals, taking the one that ends first frees the room soonest.
- If you can find a counterexample, the greedy choice is wrong: think DP instead.
Pattern
chosen = []
for item in sorted(items, key=most_promising_first):
if fits(chosen, item):
chosen.append(item)Finish these first:Sorting
Lessons
Each lesson explains one idea from zero and ends with a few tasks. Lessons open in order; the explanation can be read at any time.
Boss
05
Candy
Function
The boss opens when every lesson of the topic is finished. Solve it too and the topic is complete, and the topics after it open.