One test case is not passing

plz check the code i am giving in the chat

Hey @mohitsingh
Not handling testcases which can be solved directly by kadane

1
4
-10 1 2 -10

what to change in the code

add normal kadane method as well along with rest of the code

Hey @mohitsingh

#include<bits/stdc++.h>
using namespace std;
#define int long long 
int32_t main() {
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int arr[n];
		int arrsum=0;
		bool element_neg=true;
		int mine=INT_MIN;
		int kadanesum=INT_MIN; //added this
		for(int i=0; i<n; i++){
			cin>>arr[i];
			arrsum+=arr[i]; //added 3 lines from here
			kadanesum=max(kadanesum,arrsum);
			arrsum=max(arrsum,0ll);
		}
		arrsum=0;//added this
		for(int i=0; i<n; i++){
			if(arr[i]>0)
			element_neg=false;
			if(arr[i]>mine)
			mine=arr[i];
		}

		if(element_neg){
           cout<<mine<<endl;
		   continue;
		}
		for(int i=0; i<n; i++){
		arrsum+=arr[i];
		arr[i]=arr[i]*(-1);
		}
		int sum=0,maxsum=INT_MIN;
		for(int i=0;i<n; i++){
			
			sum+=arr[i];
			if(sum>maxsum)
			maxsum=sum;
			if(sum<0){
			   sum=0;
			}
			
		}

		cout<<max(kadanesum,(arrsum+maxsum))<<endl;//UPDATED THIS
	}
}