Maximum subarry sum

my code is showing run error.
why this run error occurs and how to remove it ?

@yogesh_chahar array size can be upto 10^5 as per constraint you have taken it of 10^3.