Given a string, return the sum of count of distinct characters in all the substrings of that string.
For example:
Input String - "test"
Possible substrings with distinct character count
"t" -> 1
"e" -> 1
"s" -> 1
"t" -> 1
"te" -> 2
"es" -> 2
"st" -> 2
"tes" -> 3
"est" -> 3
"test" -> 3Number of distinct chars - 1+1+1+1+2+2+2+3+3+3 = 19
Output - 19