Skip to content

Commit 88959e3

Browse files
authored
Update parallel-courses-ii.cpp
1 parent 3e8099b commit 88959e3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

C++/parallel-courses-ii.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ class Solution {
4141

4242
private:
4343
int dfs(const unordered_map<int, vector<int>> &graph,
44-
int idx, vector<int> *depths) {
45-
if ((*depths)[idx] == -1) {
44+
int i, vector<int> *depths) {
45+
if ((*depths)[i] == -1) {
4646
int depth = 0;
47-
if (graph.count(idx)) {
48-
for (const auto& child : graph.at(idx)) {
47+
if (graph.count(i)) {
48+
for (const auto& child : graph.at(i)) {
4949
depth = max(depth, dfs(graph, child, depths));
5050
}
5151
}
52-
(*depths)[idx] = depth + 1;
52+
(*depths)[i] = depth + 1;
5353
}
54-
return (*depths)[idx];
54+
return (*depths)[i];
5555
}
5656
};
5757

0 commit comments

Comments
 (0)