You are viewing a single comment's thread. Return to all comments →
Jaav 8 solution
int maxRepeat = 0; for(int i = 0; i < arr.size(); i++){ int num = arr.get(i); int RepeatNum = 0; for(int j = 0; j < arr.size(); j++){ if(arr.get(j) == num){ RepeatNum++; } } if(maxRepeat < RepeatNum){ maxRepeat = RepeatNum; } } return arr.size() - maxRepeat;
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 →
Jaav 8 solution