why is iy coming wrong answer again and again plz someone help
consider a simple test case
0 2 3
1 2 2
ans should be 0 but ur code gives 1
since when u have updated the values for a complete segment & return it(line 36-40)…values for child nodes are not being updated dats why in above case also node 3 is updated but not node 6 & 7.