Course Schedule II

#210
Medium
Graphs
O(V + E)
O(V)
Amazon
Microsoft
Google
View on LeetCode

Problem Description

There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai.