← 返回 uber 的题目列表Task Dependency Completion Time
类型:online_judge
Given an integer n indicating the number of tasks, and a 2D array representing task dependencies where {a, b} means task a must be finished before task b, and multiple tasks can be executed concurrently. Each task takes 1 unit time to complete. Determine the shortest time needed to complete all tasks. Provide algorithm implementation and test cases.
Example
Input
4
[[1, 3], [2, 3]]