|
12 | 12 |
|
13 | 13 | <p> </p>
|
14 | 14 | <p><strong>Example 1:</strong></p>
|
15 |
| - |
16 |
| -<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1400-1499/1494.Parallel%20Courses%20II/images/leetcode_parallel_courses_1.png" style="width: 300px; height: 164px;" /></strong></p> |
17 |
| - |
| 15 | +<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1400-1499/1494.Parallel%20Courses%20II/images/leetcode_parallel_courses_1.png" style="width: 269px; height: 147px;" /> |
18 | 16 | <pre>
|
19 |
| -<strong>Input:</strong> n = 4, dependencies = [[2,1],[3,1],[1,4]], k = 2 |
20 |
| -<strong>Output:</strong> 3 |
| 17 | +<strong>Input:</strong> n = 4, relations = [[2,1],[3,1],[1,4]], k = 2 |
| 18 | +<strong>Output:</strong> 3 |
21 | 19 | <strong>Explanation:</strong> The figure above represents the given graph.
|
22 | 20 | In the first semester, you can take courses 2 and 3.
|
23 | 21 | In the second semester, you can take course 1.
|
24 | 22 | In the third semester, you can take course 4.
|
25 | 23 | </pre>
|
26 | 24 |
|
27 | 25 | <p><strong>Example 2:</strong></p>
|
28 |
| - |
29 |
| -<p><strong><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1400-1499/1494.Parallel%20Courses%20II/images/leetcode_parallel_courses_2.png" style="width: 300px; height: 234px;" /></strong></p> |
30 |
| - |
| 26 | +<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1400-1499/1494.Parallel%20Courses%20II/images/leetcode_parallel_courses_2.png" style="width: 271px; height: 211px;" /> |
31 | 27 | <pre>
|
32 |
| -<strong>Input:</strong> n = 5, dependencies = [[2,1],[3,1],[4,1],[1,5]], k = 2 |
33 |
| -<strong>Output:</strong> 4 |
| 28 | +<strong>Input:</strong> n = 5, relations = [[2,1],[3,1],[4,1],[1,5]], k = 2 |
| 29 | +<strong>Output:</strong> 4 |
34 | 30 | <strong>Explanation:</strong> The figure above represents the given graph.
|
35 |
| -In the first semester, you can take courses 2 and 3 only since you cannot take more than two per semester. |
| 31 | +In the first semester, you can only take courses 2 and 3 since you cannot take more than two per semester. |
36 | 32 | In the second semester, you can take course 4.
|
37 | 33 | In the third semester, you can take course 1.
|
38 | 34 | In the fourth semester, you can take course 5.
|
39 | 35 | </pre>
|
40 | 36 |
|
41 |
| -<p><strong>Example 3:</strong></p> |
42 |
| - |
43 |
| -<pre> |
44 |
| -<strong>Input:</strong> n = 11, dependencies = [], k = 2 |
45 |
| -<strong>Output:</strong> 6 |
46 |
| -</pre> |
47 |
| - |
48 | 37 | <p> </p>
|
49 | 38 | <p><strong>Constraints:</strong></p>
|
50 | 39 |
|
|
0 commit comments