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

Function hasCycle

javascript/0207-course-schedule.js:59–65  ·  view source on GitHub ↗
(currCourse, graph, path)

Source from the content-addressed store, hash-verified

57};
58
59var hasCycle = (currCourse, graph, path) => {
60 for (const neighbor of graph[currCourse]) {
61 if (isCyclic(neighbor, graph, path)) return true;
62 }
63
64 return false;
65};
66
67/**
68 * https://leetcode.com/problems/course-schedule/

Callers 1

backTrackFunction · 0.70

Calls 1

isCyclicFunction · 0.85

Tested by

no test coverage detected