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 n courses you have to take, labeled from 0 to n - 1.
2
+
3
+
// Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1]
4
+
5
+
// Given the total number of courses and a list of prerequisite pairs, return the ordering of courses you should take to finish all courses.
6
+
7
+
// There may be multiple correct orders, you just need to return one of them. If it is impossible to finish all courses, return an empty array.
8
+
9
+
// For example:
10
+
11
+
// 2, [[1,0]]
12
+
// There are a total of 2 courses to take. To take course 1 you should have finished course 0. So the correct course order is [0,1]
13
+
14
+
// 4, [[1,0],[2,0],[3,1],[3,2]]
15
+
// There are a total of 4 courses to take. To take course 3 you should have finished both courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0. So one correct course order is [0,1,2,3]. Another correct ordering is[0,2,1,3].
16
+
17
+
// Note:
18
+
// The input prerequisites is a graph represented by a list of edges, not adjacency matrices. Read more about how a graph is represented.
// Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings.
2
+
3
+
// For example,
4
+
// Given [[0, 30],[5, 10],[15, 20]],
5
+
// return false.
6
+
7
+
// Hide Company Tags Facebook
8
+
// Hide Tags Sort
9
+
// Hide Similar Problems (H) Merge Intervals (M) Meeting Rooms II
// Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required.
2
+
3
+
// For example,
4
+
// Given [[0, 30],[5, 10],[15, 20]],
5
+
// return 2.
6
+
7
+
// Hide Company Tags Google Facebook
8
+
// Hide Tags Heap Greedy Sort
9
+
// Hide Similar Problems (H) Merge Intervals (E) Meeting Rooms
0 commit comments