Skip to content

Commit 4b7fd93

Browse files
authored
Update 1462-course-schedule-iv.js
1 parent 2f842ea commit 4b7fd93

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

1462-course-schedule-iv.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @return {boolean[]}
66
*/
77
const checkIfPrerequisite = function(numCourses, prerequisites, queries) {
8+
// https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
89
const n = numCourses
910
const connected = Array.from({ length: n }, () => Array(n).fill(false))
1011
for(let p of prerequisites) connected[p[0]][p[1]] = true

0 commit comments

Comments
 (0)