Back to problems

Task Dependency Completion Time

Algorithm · Uber · Medium

Problem You are given an integer n for the total number of tasks and a two-dimensional dependency list. Each pair {a, b} states that task a has to be completed before task b may begin. Tasks without unmet prerequisites may run at the same time, and every task requires exactly 1 time unit. Find the minimum overall time needed to finish every task. Provide an algorithm implementation along with test cases. Example Input: 5 Output: 2 Explanation: Tasks 1, 2, 3, and 5 can be…

Checking your access…