Maximum subarray sum

Facing problem while submitting my code
ide is not giving any judgement

this is my code -
#include<bits/stdc++.h>
using namespace std;
int maxSubArraySum(int a[],int n){
int cs = 0;
int ms = 0;
for(int i=0;i<n;i++){
cs+=a[i];
if(cs<0){
cs = 0;
}
ms = max(cs,ms);
}
return ms;
}
int main() {
int t;
cin>>t;
while(t–){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
cout<<maxSubArraySum(a,n)<<endl;
}

return 0;

}

@avinashmallik2017 hey avinash try hard refresh and then submit it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.