A deeper dive into this course schedule problem. Illustrating both DFS and Kahn's Algorithm as solutions.
00:00 Intro
0:58 Quick Solution
04:31 Directed Acyclic Graph (DAG)
05:25 Topological Sort (DFA, Khan's Algorithm)
06:38 DFS
07:23 DFS JavaScript Code
07:25 - a) Using a memo and key properties to store visited path results
12:30 - b) Drying and optimizing the first approach (No need for memo object)
14:29 - c) DFS Optimized (Array data structure for graph)
17:13 Khan's Algorithm
21:39 Khan's Algorithm JavaScript Code
25:02 Wrapping Up
Problem link: https://leetcode.com/problems/course-schedule/