#C3657. Uniform String Transformation
Uniform String Transformation
Uniform String Transformation
You are given a string s consisting of lowercase English letters. Your task is to determine the minimum number of moves required to make all the characters in the string identical. In one move, you can change any character to any other lowercase letter.
Mathematically, if the frequency of the most frequent character is \(M\) and the total number of characters is \(N\), then the minimum number of moves needed is \(N - M\).
For example, given the string "abac", the best strategy is to change two characters so that all the characters become the same (e.g. all 'a'), which requires 2 moves.
inputFormat
A single line containing a string (s) of lowercase English letters.
outputFormat
Print a single integer representing the minimum number of moves required to make the string uniform.## sample
aaaa
0