How totake input?

I don’t understand how to take n number of test cases as input. What should I do? I need a hint because my current method is just increasing time and space complexity unnecessarily!

you have to take input as mention in the question
you can use this template

int main() {
	int t;cin>>t;
	while(t--){
		int n;cin>>n;
		int arr[100000];
		for(int i=0;i<n;i++)cin>>arr[i];

		cout<<KadanesAlgo(arr,n)<<endl;
	}
	return 0;
}

now just implement KadanesAlgo function

you have not submitted the code so i can’t see 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.