My issue
what is wrong in this code?
My code
#include <iostream>
#include<algorithm>
#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 h[n];
ll fre[d]={0};
for( ll i=0;i<n;i++){
cin>>h[i];
fre[h[i]]++;
}
sort(h,h+n);
ll ans=0;
for(ll i=0;i<n;i++){
ans=max(ans,(h[i]+fre[h[i]]-1));
}
cout<<ans<<endl;
}
return 0;
}
Problem Link: PUSH7PA Problem - CodeChef