title: How to find the minimum number of operation(s) to make the string balanced?
body: <p>From <a href="https://www.codechef.com/FEB19B/problems/ARTBALAN" rel="nofollow noreferrer">Codechef</a>:</p>
  <blockquote>
  <p>A string is considered <em>balanced</em> if and only if all the characters occur in it equal number of times.</p>
  <p>You are given a string <code>S</code>; this string may only contain uppercase English letters. You may perform the following operation any number of times (including zero): Choose one letter in <code>S</code> and replace it by another uppercase English letter. Note that even if the replaced letter occurs in <code>S</code> multiple times, only the chosen occurrence of this letter is replaced.</p>
  <p>Find the minimum number of operations required to convert the given string to a balanced string.</p>
  <p>Example:</p>
  <p>For input: <code>ABCB</code></p>
  <p>Here, we can replace <code>C</code> with <code>A</code>, TO GET: <code>ABAB</code>, where each character of the string occurs for 2 times.</p>
  <p>So, the number of minimum operation(s)=<code>1</code>.</p>
  </blockquote>
  <p>How to make the string good?</p>
  <p>Can I apply dynamic programming to it ?</p>