Question
You have n tasks (0..n-1) each with a processing duration durations[i], runnable on an unlimited pool of parallel workers, subject to dependencies. `deps` is a list of [a, b] meaning task a must finish before task b starts. A task starts as soon as all its prerequisites have finished. With unlimited parallelism, the minimum time to finish ALL tasks equals the longest weighted path (critical path) through the dependency DAG, where node weights are durations. Return that minimum makespan. If the dependencies contain a cycle (unschedulable), return -1.
min_makespan(n: int, durations: list[int], deps: list[list[int]]) → int[4,[3,2,4,1],[[0,1],[0,2],[1,3],[2,3]]]out8State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.