Practice Problem

Course Schedule II

Difficulty: Medium

Given courses and prerequisites, return a valid order to take all courses (topological ordering), or an empty array if impossible.