You are viewing a single comment's thread. Return to all comments →
C++
int equalizeArray(vector <int> arr) { int n = arr.size(); int count[101] = {0}; int max = 0; for (int i = 0; i < n; i++) if (++count[arr[i]] > max) max = count[arr[i]]; return n - 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 →
C++