Skip to content

Commit 960b7cf

Browse files
add a solution for 210
1 parent a99fc6a commit 960b7cf

File tree

1 file changed

+1
-0
lines changed
  • src/main/java/com/fishercoder/solutions/firstthousand

1 file changed

+1
-0
lines changed

Diff for: src/main/java/com/fishercoder/solutions/firstthousand/_210.java

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public int[] findOrder(int numCourses, int[][] prerequisites) {
7171
while (!q.isEmpty()) {
7272
Integer curr = q.poll();
7373
order[index++] = curr;
74+
//NOTE: we only need to go through adjList[curr] here now, instead of going through all prerequisites again now.
7475
for (int v : adjList[curr]) {
7576
indegree[v]--;
7677
if (indegree[v] == 0) {

0 commit comments

Comments
 (0)