advancedGraphs
Course schedule (topological order)
You must take numCourses courses with prerequisites given as pairs (a, b) meaning 'b before a'. Return true if you can finish every course.
Examples
input 4, [[1,0],[2,0],[3,1],[3,2]]
output true
0 → 1,2 → 3 is a valid order.
input 2, [[1,0],[0,1]]
output false
Each course requires the other — a cycle.
Hints
Try the problem first. Hints are revealed one at a time so you keep thinking.
Solution
The written approach, complexity analysis and follow-ups stay hidden until you ask for them.