(currCourse, graph, path)
| 57 | }; |
| 58 | |
| 59 | var 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/ |