My issue
plz help fix the error …
My code
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
ll n;
cin>>n;
ll a[n];
for(ll i=0;i<n;i++){
cin>>a[i];
}
sort(a,a+n,greater<int>());
ll count=0;
for(ll i=0;i<n;i++){
if(a[i]==a[i+1]){
a[i]+=a[0];
sort(a,a+i,greater<int>());
count++;
}
else{
continue;
}
}
cout<<count<<endl;
}
return 0;
}
Problem Link: MIXCOLOR Problem - CodeChef