Why first test case not passing?

all other test cases passed except for the first test case???

Hello @ssanjuchandra, pls refer this …


This is your modified code. See it is allowed in that to take one node with neg value and another with positive value if they are getting overall max value and your code was not considering this.
In line no. 23 I made max1 and max2 = -1e16 , so that while maximising them the negative value can also come.