Code working fine with custom test cases but fails with system test cases

when I run the code with same custom input as that of second case my code works fine but when I submit the same code the second test case fails which works fine when I provide it as custom input.

Hey @pjain
Can you post your code?

#include
using namespace std;
int main() {
int n;
cin>>n;
int cur=0;
int m=0;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
cur=a[i];
m=max(cur,m);
}
cout<<m;
return 0;
}

@pjain take m initially as INT_MIN and not 0,
because the array can contain negative numbers also, so initially put m as minimum possible integer which is INT_MIN then it’ll be gradually replaced by the max as the code runs