1101. Parallel Courses

Medium
Graph
Topological Sort

Description

Hints

Hint 1
Try to think of it as a graph problem. It will be impossible to study all the courses if the graph had a cycle.
Hint 2
The graph is a directed acyclic graph (DAG). The answer is the longes path in this DAG.
Hint 3
You can use DP to find the longest path in the DAG.

Statistics

Acceptance
62.0%
Submissions
170,123
Accepted
105,412