Problem in submitting the code for kadane's algo

#include
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
int a[100];
int cumsum[1000]={0};
int maxsum=0;
int currentsum=0;

for(int i=0;i<n;i++)
    cin>>a[i];

for(int i=0;i<n;i++){

        currentsum+=a[i];

        if(currentsum<0)
        {
            currentsum=0;

        }


        maxsum=max(maxsum,currentsum);


}
 cout<<maxsum<<endl;

}
}

Hey Aman, read the constraints carefully,
1 <= N <= 100000
0 <= A[i] <= 100000000

So, you are supposed to use long long int instead of int data type, and as the N can be of range 100000 but you are taking the array of max size 100 only.

Hey Aman, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required. And please mark your doubts as resolved in your course’s “Ask Doubt” section, when your doubt is resolved.