My issue
I can’t understand why my code only solves the question partially, what boundary condition am I missing ?
My code
#include <iostream>
using namespace std;
int main(){
int t; cin>>t;
while(t--){
int n,min=2147483647; cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
if(arr[i]<min) min=arr[i];
}
cout<<min*(n-1)<<endl;
}
return 0;
}
Problem Link: MNMX Problem - CodeChef