My issue
i am not able to solve
My code
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int N;
cin>>N;
int A[N];
for(int i=0;i<N;i++){
cin>>A[i];
}int max=A[0];
for(int j=1;j<N;j++){
if(max>A[j])
max= max;
else
max=A[j];
}
// int secmax;
// secmax=A[0];
// for(int i=1;i<N;i++){
// if(secmax<max){
// }
// }
}cout<<max<<'\n';
// your code goes here
return 0;
}
Learning course: Arrays using C++
Problem Link: Largest and Second Largest Practice Problem in - CodeChef