Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr


        

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, you will still get Wrong Answer because the complete output may be longer and there might be errors in the future lines.

Please double check your code to solve this problem and try again.

Your Answer

Entering BinaryTree
val = 8
Entering BinaryTree
val = 3
Entering BinaryTree
val = 5
Entering BinaryTree
Entering copy
Entering copy
root is nullptr
Entering copy
root is nullptr
newNode->val = 3
Entering copy
Entering copy
root is nullptr
Entering copy
root is nullptr
newNode->val = 8
val = 5
left.root = 0x55b81c7aa240
right.root = 0x55b81c7aa220
Entering ~BinaryTree
Entering removeAll
root->val = 3
Entering removeAll
root is nullptr
Entering removeAll
root is nullptr
Entering ~BinaryTree
Entering removeAll
root->val = 8
Entering removeAll
root is nullptr
Entering removeAll
root is nullptr
Entering BinaryTree
val = 18
Entering BinaryTree
val = 12
Entering BinaryTree
val = 15
Entering BinaryTree
Entering copy
Entering copy
root is nullptr
Entering copy
root is nullptr
newNode->val = 12
Entering copy
Entering copy
root is nullptr
Entering copy
root is nullptr
newNode->val = 18
val = 15
left.root = 0x55b81c7aa240
right.root = 0x55b81c7aa220
Entering ~BinaryTree
Entering removeAll
root->val = 12
Entering removeAl

JOJ Answer

Test 7: The sum of the assigned tree is 71