Maximum sub array sum help me out

for every code be it for n^2 n^3 n^4 , it is showing run error for every code… please help me out

My code is as folows:

please provide your code by saving it on the online ide

1 Like

sorry for inconvenience… Now I have edited my post…
Please help

there was a small error in your code

  1. declare the int array inside the for statement(loop which runs for the number of test cases provided)
  2. declare it as of size int arr[n] instead of int arr[100]
    i have corrected it
    https://ide.codingblocks.com/s/94144
1 Like

Thanking you ma’am for ur sincere support… ur modification helped me to submit the code and reduce the space complexity.

1 Like