title: Find maximum deviation of all substrings
body: <p>Given a string, find the <code>maximum deviation</code> among all substrings. The maximum deviation is defined as the difference between the maximum frequency of a character and the minimum frequency of a character.</p>
  <p>For example, in <code>abcaba</code>, <code>a</code> has a frequency of 3; <code>b</code> has a frequency of 2; <code>c</code> has a frequency of 1. so <code>a</code> has the maximum frequency, which is 3, whereas <code>c</code> has a minimum frequency of 1. Therefore the deviation of this string is <code>3 - 1 = 2</code>. And we also need to find all other deviations for each of the substrings for <code>abacaba</code>, the maximum among them is the answer.</p>
  <p>I couldn't think of a better way rather than the obvious brute force approach. Thanks in advance!</p>