Completing All Courses with Prerequisites

Asked at Apple · Coding Questions · Difficulty: Medium · Last asked Mar 20, 2026

A student must complete a number of courses, and some courses can only be taken after others. Decide whether there is an order in which every course can be taken so that each course's prerequisites come before it.

Loading the problem…