My issue
what is issue in this code
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int n;
cin>>n;
while(n--){
int m;
cin>>m;
vector<int>v;
for(int i=0;i<m;i++){
int ele;
cin>>ele;
v.push_back(ele);
}
sort(v.begin(),v.end());
int s=v[0];
for(int i=1;i<m;i++){
if(v[i]==1) s+=v[i];
else s*=v[i];
}
cout<<s<<endl;
}
}
Problem Link: Encrypt Value Practice Coding Problem - CodeChef