You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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.
6
+
7
+
# For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1.
8
+
9
+
# Return true if you can finish all courses. Otherwise, return false.
10
+
11
+
12
+
13
+
# Example 1:
14
+
15
+
# Input: numCourses = 2, prerequisites = [[1,0]]
16
+
# Output: true
17
+
# Explanation: There are a total of 2 courses to take.
18
+
# To take course 1 you should have finished course 0. So it is possible.
0 commit comments