3 testcase failed

link to my code : https://ide.codingblocks.com/s/243021
I checked with the code shown in video, but still only 1 testcase passed out of 4.
What’s wrong with my code ???

hello @O17LPOLA020011
a) summation can exceed the range of int so use long long
b) total sum of a node can also be a valid candidate for maximum so include that as well while updating max sum of a node

still not working :frowning:
int is defined as long long as a macro
link to code after the above update : https://ide.codingblocks.com/s/244230

image
this line should be
image

also
image

check ur updated code here

That worked !
Thank you so much for your time and effort. :wink:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.