Maximum subarray sum

I have tested my code on other online compilers and it executes.However,it shows time exceeded on compiling in the coding blocks IDE