Skip to content

Commit a59d810

Browse files
authored
Update smallest-missing-genetic-value-in-each-subtree.cpp
1 parent 136fee7 commit a59d810

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

C++/smallest-missing-genetic-value-in-each-subtree.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Solution {
1010
return result;
1111
}
1212
vector<vector<int>> adj(size(parents));
13-
for (int i = 1; i < size(parents); ++i) {
14-
adj[parents[i]].emplace_back(i);
13+
for (int j = 1; j < size(parents); ++j) {
14+
adj[parents[j]].emplace_back(j);
1515
}
1616
unordered_set<int> lookup;
1717
for (int miss = 1; i >= 0; i = parents[i]) {
@@ -30,7 +30,7 @@ class Solution {
3030

3131
vector<int> stk = {i};
3232
while (!empty(stk)) {
33-
const int i = stk.back(); stk.pop_back();
33+
i = stk.back(); stk.pop_back();
3434
if (lookup->count(nums[i])) {
3535
continue;
3636
}

0 commit comments

Comments
 (0)