Back to problems

Minimum Time to Finish All Dependent Tasks with Durations (Detect Cycles)

Algorithm · Netflix · Medium

Problem You have n tasks numbered 1 through n. Task i requires time[i] (a positive integer) units of time to execute. You are also given a list of dependency pairs dependencies, where each pair (u, v) indicates that task u must finish before task v can begin. A task can start the moment all of its prerequisites are done. Parallel execution is permitted: any number of tasks whose dependencies are satisfied may run at the same time. Determine the minimum total time needed to…

Checking your access…