Max subarray sum


i am getting wrong answer when i submit
but when i run the sample code it shows be the correct output