You are viewing a single comment's thread. Return to all comments →
i think best solution with time effirecent may be count as`
int equalizeArray(vector<int> arr) { map<int,int > a; for(int i=0;i<arr.size();i++){ a[arr[i]]++; } int max=0; for(int i=0;i<a.size();i++){ if(max<a[i]){ max=a[i]; } } return arr.size()-max; }
Seems like cookies are disabled on this browser, please enable them to open this website
Equalize the Array
You are viewing a single comment's thread. Return to all comments →
i think best solution with time effirecent may be count as`