The beauty of a string is the difference between the frequency of its most frequent character and the frequency of its least frequent character (counting only characters that appear).
For example, the beauty of "abaacc" is 3 - 1 = 2.
Given a string s, return the sum of the beauty of all of its substrings.