Search
⌘K

Leetcode 1136. Parallel Courses

Given n courses and prerequisite pairs, determine the minimum number of semesters required to finish all courses if you can take any number of courses per semester as long as all their prerequisites are already completed; return -1 if a cycle makes completion impossible. This reduces to topological sorting / BFS layer-by-layer on the DAG to count semesters (or detecting cycles).

Asked at:

Snowflake


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early January, 2026

Snowflake

Mid-level

Comments

Your account is free and you can post anonymously if you choose.