Pregunta de entrevista de Amazon

Topological Sort, Course Scheduling Question