#include
using namespace std;
int main() {
int n,a[1000000000],i,s=0;
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
{if(s<a[i])
s=a[i];
}
cout<<s;
return 0;
}
One testcase is failed
hi anshul
ur code fails if all the elements are negative as u intialize s with 0 so it will always gave 0
initialize s with a very low number
like s=-99999999