← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given numCourses courses labeled from 0 to numCourses - 1 and a list of prerequisites where prerequisites[i] = [a, b] indicates course a requires course b to be taken first, return a valid ordering to finish all courses.
If it is impossible to finish all courses (due to a cycle), return an empty array.