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

Function initGraph

javascript/0207-course-schedule.js:14–17  ·  view source on GitHub ↗
(numCourses)

Source from the content-addressed store, hash-verified

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

Callers 1

buildGraphFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected