Your Submissions
You haven't submitted any code for this challenge yet. Solve the problem by passing all the test cases, and your submissions will appear here.
xxxxxxxxxx
145
var assert = require('assert');
class CourseSchedule {
areAllCoursesPossible(numCourses, prerequisites) {
// implement this method
return true;
}
dfs(courseIdx, onThePath) {
// might be helpful
}
}
class Graph {
constructor() {
this.adjacencyList = new Map();
this.verticesCount = 0;
}
addVertex(nodeVal) {
this.adjacencyList.set(nodeVal, []);
this.verticesCount++;
}
addEdge(src, dest) {
this.adjacencyList.get(src).push(dest);
this.adjacencyList.get(dest).push(src);
OUTPUT
Results will appear here.