Regarding maximum sub array sum

https://ide.codingblocks.com/s/68095
This is my ide .You have asked my ide to resolve this problem.
this code shows run error ,I couldn’t identify it.please help me.

Hi Raushan, there are 2 errors in your code:

  1. It is given that A[i] can be as big as 100000000 so it will not fit in int. You need to change the data type.
  2. Although, it was a different thing the main thing which was causing Runtime Error to your program was the thing that you fixed the size of arrays a and cumSum to 1000 and 100 whereas its size can be bigger than. So change it’s size to n.

Your code will work now. Hope this helps :slight_smile:

Hey Raushan,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.