Maxsubarray--3 test case not passing

waiting for your reply

Please once dry run your code for the testcase below you will get the mistake :
Input:
4
1 2 3 4
Desired output is : 7
Output from your code : 6

unable to find the mistake