canFinish = function(numCourses, prerequisites) {
    const { graph, visited, path }  = buildGraph(numCourses, prerequisites);

    for (let currCourse = 0; currCourse < numCourses; currCourse++) {
        if (isCyclic(currCourse, graph, visited, path)) return false;
    }

    return true;
}
https://leetcode.com/problems/course-schedule/
Time O(V + E) | Space O(V + E)
@param {number} numCourses
@param {number[][]} prerequisites
@return {boolean}