Skip to content

Commit a56ab3d

Browse files
committed
Runtime: 435 ms (Top 42.70%) | Memory: 45.5 MB (Top 33.71%)
1 parent a724a8e commit a56ab3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/P/Parallel Courses II/Parallel Courses II.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 435 ms (Top 42.70%) | Memory: 45.5 MB (Top 33.71%)
12
class Solution {
23
public int minNumberOfSemesters(int n, int[][] relations, int k) {
34
int[] ok = new int[1 << n];
@@ -10,7 +11,7 @@ public int minNumberOfSemesters(int n, int[][] relations, int k) {
1011
for (int i = 0; i < 1<<n; i++){
1112
if (dp[i]!=30){
1213
tryAll(0, k, i, i, n, ok, dp);
13-
}
14+
}
1415
}
1516
return dp[(1<<n)-1];
1617
}
@@ -23,4 +24,4 @@ private void tryAll(int idx, int k, int cur, int old, int n, int[] ok, int[] dp)
2324
}
2425
dp[cur]=Math.min(dp[cur], dp[old]+1);
2526
}
26-
}
27+
}

0 commit comments

Comments
 (0)