(numCourses)
| 12 | }; |
| 13 | |
| 14 | var initGraph = (numCourses) => ({ |
| 15 | graph: new Array(numCourses).fill().map(() => []), |
| 16 | path: new Array(numCourses).fill(false), |
| 17 | }); |
| 18 | |
| 19 | var buildGraph = (numCourses, prerequisites) => { |
| 20 | const { graph, path } = initGraph(numCourses); |