Given which tasks depend on which, print an order that runs a chosen task after everything it needs — and nothing else.
Given which tasks depend on which, print an order that runs a chosen task after everything it needs — and nothing else.
Opens with the full question.