MCPcopy Index your code
hub / github.com/neetcode-gh/leetcode / hasPath

Function hasPath

javascript/0207-course-schedule.js:33–39  ·  view source on GitHub ↗
(numCourses, graph, path)

Source from the content-addressed store, hash-verified

31};
32
33var hasPath = (numCourses, graph, path) => {
34 for (let course = 0; course < numCourses; course++) {
35 if (isCyclic(course, graph, path)) return false;
36 }
37
38 return true;
39};
40
41var isCyclic = (currCourse, graph, path) => {
42 const hasSeen = path[currCourse];

Callers 1

canFinishFunction · 0.70

Calls 1

isCyclicFunction · 0.85

Tested by

no test coverage detected