Algorithm · Oracle · Medium
There are n courses, numbered from 0 to n - 1. Some courses must be completed after others: a prerequisite entry [a, b] means course b has to be finished before course a can be started. Given n and a list prerequisites of such pairs, build an ordering of all courses that satisfies every prerequisite. Return the ordering as an integer array. If several valid orderings exist, returning any one of them is acceptable. If no such ordering exists because the prerequisites form a…
Checking your access…