Parallel Courses III

There are n courses numbered from 1 to n. Each pair [u, v] in relations means that course u must be completed before course v can start. The prerequisite graph contains no cycles.

`time...

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: