Maximum subarray sum

i am unable to understand that why am i failing all the test cases in my code kindly clear my doubt

ur code does not handle -ve test cases
when all the elements in the array are -ve then the code fails