3rd testcase is not passed.
Please check!!
Array challenges
Plz change line no 6 to int max=a[0];, and also akshit, plz follow the input given,
else{
cout<<“Wrong Input”<<endl;
}
}else{
cout<<“Wrong Input”<<endl;
}
These conditions are not given in question, so plz dont use them too
but if i intialize it with 0 then also in the first case when i =0
but if i intialize it with 0 then also in the first case when i =0 it update 2>0 so max=2…this should not affect the output.
But it wont work for all test cases, try submitting by taking max as ar[0] only