Leetcode - Course Schedule II (Python)

preview_player
Показать описание
July 2020 Leetcode Challenge
Leetcode - Course Schedule II
Рекомендации по теме
Комментарии
Автор

great explanation, you're the best

snce
Автор

if im not mistaken, this code would not work for if there are 2 nodes with no prerequisites, but both nodes directs to a similar node.
I.E.
0 -> 2
0 -> 3
1 -> 3
3-> 2

The topological sort would be off due to 3 having a prerequisite of 1 when DFS is called on 3 correct?

Dan-tggs
welcome to shbcf.ru