labuladong / fucking-algorithm

刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.

Home Page:https://labuladong.github.io/algo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug][javascript] course-schedule

Followinsider opened this issue · comments

请在提交 bug 之前先搜索

  • 我已经搜索过 issues,没有发现相同的 bug。

出错的题目链接

https://leetcode.cn/problems/course-schedule/

报错信息

Line 52 in solution.js
graph[from].push(to);
^
TypeError: Cannot read properties of undefined (reading 'push')
Line 52: Char 25 in solution.js (buildGraph)
Line 12: Char 19 in solution.js (canFinish)
Line 71: Char 19 in solution.js (Object.)
Line 16: Char 8 in runner.js (Object.runner)
Line 60: Char 26 in solution.js (Object.)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

你是否愿意提交 PR 修复这个 bug?

  • 我愿意!