Skip to content

Instantly share code, notes, and snippets.

class Solution(object):
def findOrder(self, numCourses, prerequisites):
"""
:type numCourses: int
:type prerequisites: List[List[int]]
:rtype: List[int]
"""
self.prereqList = [[] for i in xrange(numCourses)]
for prereq in prerequisites: