My issue
How to find the hidden test case that it is failing for
My code
#include <bits/stdc++.h>
using namespace std;
void solve(){
int n;
cin>>n;
int i,j,k,l;
vector<int>a(n);
for(i=0;i<n;i++){
cin>>a[i];
}
int mini = *min_element(a.begin(),a.end());
int ans = mini*n;
for(i=0;i<n;i++){
if(a[i]>mini)
ans++;
}
cout<<ans<<endl;
}
signed main() {
// your code goes here
int t;
cin>>t;
while(t--){
solve();
}
return 0;
}
Learning course: 1800 to 2000 difficulty problems
Problem Link: The One with All the Candy Practice Problem in 1800 to 2000 difficulty problems