Skip to content

Commit 6bc463f

Browse files
authored
Update redundant-connection-ii.cpp
1 parent 3f403d9 commit 6bc463f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/redundant-connection-ii.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Solution {
4545
if (x_root == y_root) {
4646
return false;
4747
}
48-
set_[y_root] = x_root;
48+
set_[min(x_root, y_root)] = max(x_root, y_root);
4949
return true;
5050
}
5151

0 commit comments

Comments
 (0)