Make Frequency of all characters equal

Given a string , return the minimum no.of characters to delete to make frequency of all the characters equal.
Note: The string only contains lowecase letters

Ex: "xyzxyyxzzzz"
output: 2
Explanation : The fequency of elements x->3,y->3,z->5 . So we can delete the extra 2 z's to make frequency of all elements equal. 
Ex: "xyz"
output : 0
Explanation : The frequency of all elements is already equal.

This question was asked in relevel exam recently

Comments (3)