Problem - LOSTMAX
level . beginner
here is the code
"
#include
#include
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
vector a;
char x;
int n=0;
int temp;
do
{
cin>>temp;
a.push_back(temp);
n++;
x=getchar();
} while(x!='\n');
n--;
for(int i=0;i<n;i++)
{
if(a[i]==n)
{
a[i]=0;
}
break;
}
int y=a[0];
for(int i=0;i<n;i++)
{
if(y<a[i])
{
y=a[i];
}
}
cout<<endl<<y;
}
return 0;
}
"
thanks for help in advance