I am always getting error at Testcase 1 - Wrong Answer. However my code is giving the correct answer (I unlocked and downloaded TestCases to confirm).
My code is as follows:
#include
using namespace std;
int main() {
int TC = 0;
cin >> TC;
int maxSum = 0;
for (int idx =0 ; idx < TC; idx ++){
int N;
cin>> N;
int currSum = 0;
int temp;
cin >> temp;
maxSum = temp;
currSum = temp;
for (int idxj = 1; idxj < N; idxj ++ ) {
cin >> temp;
currSum += temp;
maxSum = max(currSum, maxSum);
}
}
cout <<maxSum;
return 0;
}