QuestionThere are a total ofnumCoursescourses you have to take, labeled from0tonumCourses - 1. You are given an arrayprerequisiteswhereprerequisites[i] = [ai, bi]indicates that youmusttake coursebifirst if you want to take courseai.For example, the pair[0, 1], indicates that to take course0you have to first take course1.Returnthe ordering of courses you should take to finish all courses. If there are many valid answers, returnanyof them. If it is impossible to finish all courses, returnan empty array.Example 1:Input: numCourses = 2, prerequisites = [[1,0]]
Output: [0,1]
Explanation: There are
...
继续阅读
(62)