@@ -0,0 +1,969 @@
+# Based on the solution of CouseScheduleI%0A# However, I need to figure out my own solution%0A%0A%0Aclass Solution(object):%0A    def findOrder(self, numCourses, prerequisites):%0A        %22%22%22%0A        :type numCourses: int%0A        :type prerequisites: List%5BList%5Bint%5D%5D%0A        :rtype: List%5Bint%5D%0A        %22%22%22%0A        indegrees = %5B0%5D * numCourses%0A        graphs = %5B set() for _ in range(numCourses) %5D%0A        for p in prerequisites:%0A            if p%5B0%5D not in graphs%5Bp%5B1%5D%5D:%0A                graphs%5Bp%5B1%5D%5D.add(p%5B0%5D)%0A                indegrees%5Bp%5B0%5D%5D += 1%0A        queue = %5B i for i in range(len(indegrees)) if indegrees%5Bi%5D == 0 %5D%0A        res = queue%5B:%5D%0A        %0A        while len(queue) != 0:%0A            root = queue.pop(0)%0A            for i in graphs%5Broot%5D:%0A                indegrees%5Bi%5D -= 1%0A                if indegrees%5Bi%5D == 0:%0A                    queue.append(i)%0A                    res.append(i)%0A                %0A        if sum(indegrees) != 0:%0A            return %5B%5D%0A        return res%0A

Create CourseSchedueII_001.py