classSolution{publicintminimumPushes(String word){int res =0;int[] frequency =newint[26];for(int i =0; i < word.length(); i++){char c = word.charAt(i);
frequency[c -'a']++;}Arrays.sort(frequency);for(int i =25; i >=0; i--){if(frequency[i]==0){break;}
res = res + frequency[i]*((25- i)/8+1);}return res;}}