Given an arbitrary binary tree, convert it to a binary tree that holds such property :
->For every node, data value must be equal to sum of data values in left and right children.
->Consider data value as 0 for NULL children.
You can only increment data values in any node (You cannot change the structure of the tree and cannot decrement the value of any node).
Your code will run on multiple test cases (<= 50)
1 <= Number of Nodes <= 500
1 <= Value at Node <= 2000
5 / \ 2 10 / \ / \ 1 5 5 5
16 / \ 6 10 / \ / \ 1 5 5 5
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.