You are viewing a single comment's thread. Return to all comments →
public class Solution {
// Complete the equalizeArray function below. static int equalizeArray(int[] arr) { Arrays.sort(arr); int[] temp=new int[arr[arr.length-1]+1]; for(int i=0;i<arr.length;i++){ temp[arr[i]]++; } Arrays.sort(temp); int result=arr.length-temp[temp.length-1]; return result; }
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 →