Faulty test case


#1

The test case is showing answer for 11 151 172 88 -1 148 -1 86 -1 -1 -1 -1
equal to 260 172 172 88 88, why is it also changing the value of the children to make it equal to its parent. My solution is returning 260 172 148 88 86. There are the preorder traversal of the resulting tree.