the appeal string number distinct character find stringfor example appeal abbca 3 3 distinct character b cGiven string s return total appeal substringsa substre contiguous sequence character string Example 1input s abbcaoutput 28explanation the follow substring abbca Substrings length 1 b b c appeal 1 1 1 1 1 respectively the sum 5 Substrings length 2 ab bb bc appeal 2 1 2 2 respectively the sum 7 Substrings length 3 abb bbc bca appeal 2 2 3 respectively the sum 7 Substrings length 4 abbc bbca appeal 3 3 respectively the sum 6 Substrings length 5 abbca appeal 3 the sum 3the total sum 5 7 7 6 3 28example 2input s codeoutput 20explanation the follow substring code Substrings length 1 c o d e appeal 1 1 1 1 respectively the sum 4 Substrings length 2 co od de appeal 2 2 2 respectively the sum 6 Substrings length 3 cod ode appeal 3 3 respectively the sum 6 Substrings length 4 code appeal 4 the sum 4the total sum 4 6 6 4 20 Constraints1 slength 105s consist lowercase english letter