My issue
i dont know which answer is wrong and which taste case failed .can you tell me test case across 2nd
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int n,maxi=0,sum=0;
cin>>n;
int arr[n],sales[n];
for(int i=0;i<n;i++)
cin>>arr[i];
for(int i=0;i<n;i++){
sum+=arr[i];
sales[i]=sum+arr[i];
}
for(int i=0;i<n;i++){
maxi=max(sales[i],maxi);
}
cout<<maxi<<endl;
}
return 0;
}
Problem Link: Sale Practice Coding Problem - CodeChef