+ 1
How to find minimum operations required to make frequency of each character in a given string equal
Eg. Input string:- ABCB Output :- 1(A can be changed to C so that frequency of B and C becomes 2)
2 odpowiedzi
+ 3
What would be the minimum for ABCDEE? 1 because one E can be changed e.g. to an F? Or can we only use letters that already appear in the string?
0
We should use only those characters that already appear in the string.
In ABCDEE we can replace A with B and C with D so that each character will have 2 frequency and minimum operations will be 2.