Can anyone tell me what's problem in my code ,its written in C


#1

Comment body goes here.nt maxSubArray(const int* A, int n1) {
int i,j,ans=0;

if(n1!=1) {
for(i=0;i<n1;i++){

   int  sum=A[i];
   j=i+1;
    while(j<n1&&j>=1){
        
        sum=sum+A[j];
        if(sum>ans){
            ans=sum;
            
        }
        j++;
    }
}

}
else{
ans=A[0];
}
return ans;

}