What's wrong in this code i checked almost all inputs i can think of

my code

#include
#include
using namespace std;
int main() {
int N,t,k=0,i=0,arr[20]={0},test[100000]={0};
cin>>N;
while(i<N)
{
cin>>t;
for(int j=0;j<t;j++)
{
cin>>arr[j];
}
int j=0,ms=0,cs=0;
while(arr[j]<0)
{
j++;
}
for(;j<t;j++)
{
cs=arr[j]+cs;
if(cs<0)
{
cs=0;
}
if(ms<cs)
{
ms=cs;
}
}
if(ms==0)
{
ms=INT_MIN;
for(int j=0;j<t;j++)
{
ms=max(ms,arr[j]);
}
}
test[k]=ms;
k++;
i++;
}
for(int i=0;i<N;i++)
{
cout<<test[i]<<endl;
}
return 0;
}

Please share the link of Code

How to Share Link of Code??

  1. paste your code at https://ide.codingblocks.com/

  2. click->file->save

  3. after a link will be generated at top in place of url something like: https://ide.codingblocks.com/s/12345

  4. share this link

  1. size of array you takes is 20 only
  2. why you are using test array just print the ans without storing in array
#include<iostream>
#include<climits>
using namespace std;
int main() {
	int N,t,k=0,i=0,arr[100000];
	cin>>N;
	while(i<N)
	{
		cin>>t;
		for(int j=0;j<t;j++)
		{
			cin>>arr[j];
		}
		int j=0,ms=0,cs=0;
		while(arr[j]<0)
		{
			j++;
		}
		for(;j<t;j++)
		{
			cs=arr[j]+cs;
			if(cs<0)
			{
				cs=0;
			}
			if(ms<cs)
			{
				ms=cs;
			}
		}
		cout<<ms<<endl;
		i++;
	}
	return 0;
}

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.