Maximum subarray sum

Hello i’ve been trying hard on this problem, could you please tell me where i’m going wrong?

@msid78641
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
you can refer to this