Back to problems

Prerequisite Cycle OA

Algorithm · JPMorgan · Medium

Examples Example 1 Example 2 Requirements Using numCourses together with prerequisite pairs, determine whether every course can be completed. The solver should implement canFinish(numCourses, prerequisites) -> bool, where prerequisites is a list of [course, prerequisite] pairs. A pair of prerequisites indicates that one class cannot be taken until the other listed class has been finished. Produce a boolean result. Apply the usual Course Schedule interpretation of…

Checking your access…