Maximum subarray sum

https://hack.codingblocks.com/app/contests/1236/704/problem problem link and
https://ide.codingblocks.com/s/267091 my code link
output to aa rhe ha but testcase me fail ho jaa raha hai

bro … just define your array inside while loop and don’t give array size of test case value.
while(t–){
int k ;
cin >> k;
int arr[k];
}