Minimum courses required to complete mandatory list given prerequisites
Filed under Sprinklr
The question
Given n tasks labeled 0 to n - 1, a list of prerequisite pairs [a, b], and a target list of mandatory courses, determine the minimum total number of courses required to finish all mandatory courses. Return -1 if completing them is impossible.
No write-up yet. Related questions below have one.
Related Sprinklr questions
Collected from public candidate posts and coding forums. Updated Nov 2026.