Skip to content

Commit 8268758

Browse files
authored
Update binary-tree-coloring-game.cpp
1 parent 0592964 commit 8268758

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

C++/binary-tree-coloring-game.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ class Solution {
2929
const auto& left = count(root->left, x, left_right);
3030
const auto& right = count(root->right, x, left_right);
3131
if (root->val == x) {
32-
left_right->first = left;
33-
left_right->second = right;
32+
*left_right = make_pair(left, right);
3433
}
3534
return left + right + 1;
3635
}

0 commit comments

Comments
 (0)