Task Execution Order with Dependencies

Given a set of tasks, each with a list of tasks it depends on (guaranteed acyclic), and a list of target tasks to run, output all tasks that need to be executed (the targets plus all their direct and ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: