We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a99fc6a commit 960b7cfCopy full SHA for 960b7cf
src/main/java/com/fishercoder/solutions/firstthousand/_210.java
@@ -71,6 +71,7 @@ public int[] findOrder(int numCourses, int[][] prerequisites) {
71
while (!q.isEmpty()) {
72
Integer curr = q.poll();
73
order[index++] = curr;
74
+ //NOTE: we only need to go through adjList[curr] here now, instead of going through all prerequisites again now.
75
for (int v : adjList[curr]) {
76
indegree[v]--;
77
if (indegree[v] == 0) {
0 commit comments