Run Error in all test cases

The code I have written is correctly giving me output for maximum sum of subArray, however i am failing test cases.

this is my code

i have written a separate code which doesnt use recursion. Even this code is failing all test cases all test cases even after correct answers.

Link to second code : https://ide.codingblocks.com/s/388908