The beauty of a string is defined as the difference between the maximum frequency and the minimum frequency of any character that appears in that string.
Given a string s, return the total sum of the beauty of all its substrings.
Constraints:
s.length
s consists of only lowercase English letters.
The beauty of a string is defined as the difference between the maximum frequency and the minimum frequency of any character that appears in that string.
Given a string s, return the total sum of the beauty of all its substrings.
Constraints:
s.length
s consists of only lowercase English letters.